From 9c51ddb30c77f9f394d83fcc69c1392f20968ea2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 12 Dec 2024 20:59:56 +0000 Subject: [PATCH] feat: Update Compute Engine API to revision 20241201 (#971) Source-Link: https://github.com/googleapis/googleapis/commit/7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ddc476d4cce6f07b51cc696ffc3e0c4c761bb18 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMmRkYzQ3NmQ0Y2NlNmYwN2I1MWNjNjk2ZmZjM2UwYzRjNzYxYmIxOCJ9 --- .../Google/Cloud/Compute/V1/Compute.php | Bin 0 -> 685486 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 | 301 + .../PerformanceMonitoringUnit.php | 76 + .../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 | 75 + .../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 | 138 + .../Cloud/Compute/V1/AuditLogConfig.php | 152 + .../Compute/V1/AuditLogConfig/LogType.php | 78 + .../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 | 589 ++ .../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/BackendBucketUsedBy.php | 76 + .../Cloud/Compute/V1/BackendService.php | 1892 ++++++ .../V1/BackendService/CompressionMode.php | 64 + .../IpAddressSelectionPolicy.php | 78 + .../V1/BackendService/LoadBalancingScheme.php | 90 + .../V1/BackendService/LocalityLbPolicy.php | 104 + .../Compute/V1/BackendService/Protocol.php | 102 + .../V1/BackendService/SessionAffinity.php | 113 + .../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 + .../Compute/V1/BackendServiceHttpCookie.php | 165 + .../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 | 76 + .../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 | 192 + .../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 | 1021 +++ .../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 | 170 + .../Compute/V1/CommitmentAggregatedList.php | 320 + .../Cloud/Compute/V1/CommitmentList.php | 287 + .../Compute/V1/CommitmentResourceStatus.php | 77 + .../Compute/V1/CommitmentsScopedList.php | 110 + .../Compute/V1/ConfidentialInstanceConfig.php | 125 + .../ConfidentialInstanceType.php | 78 + .../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/CustomErrorResponsePolicy.php | 111 + ...rResponsePolicyCustomErrorResponseRule.php | 155 + .../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 | 2165 ++++++ .../Cloud/Compute/V1/Disk/AccessMode.php | 71 + .../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 + .../Compute/V1/GetNetworkProfileRequest.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 | 115 + .../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 | 865 +++ .../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 | 504 ++ .../Compute/V1/HealthStatus/HealthState.php | 63 + .../V1/HealthStatus/Ipv6HealthState.php | 53 + .../Compute/V1/HealthStatus/WeightError.php | 77 + .../V1/HealthStatusForNetworkEndpoint.php | 304 + .../HealthState.php | 75 + .../Ipv6HealthState.php | 55 + .../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 | 375 ++ .../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 | 1361 ++++ .../ListManagedInstancesResults.php | 64 + .../V1/InstanceGroupManagerActionsSummary.php | 604 ++ .../V1/InstanceGroupManagerAggregatedList.php | 320 + ...InstanceGroupManagerAllInstancesConfig.php | 76 + .../InstanceGroupManagerAutoHealingPolicy.php | 120 + ...eGroupManagerInstanceFlexibilityPolicy.php | 66 + ...anceFlexibilityPolicyInstanceSelection.php | 110 + ...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 + .../V1/InstanceGroupManagerStandbyPolicy.php | 124 + .../Mode.php | 64 + .../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 + ...nceGroupManagersResumeInstancesRequest.php | 66 + .../V1/InstanceGroupManagersScopedList.php | 110 + ...roupManagersSetInstanceTemplateRequest.php | 76 + ...anceGroupManagersSetTargetPoolsRequest.php | 110 + ...anceGroupManagersStartInstancesRequest.php | 66 + ...tanceGroupManagersStopInstancesRequest.php | 110 + ...ceGroupManagersSuspendInstancesRequest.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 | 290 + .../Type.php | 80 + ...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 | 473 ++ .../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 + .../Compute/V1/ListNetworkProfilesRequest.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 + .../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 | 765 +++ .../Compute/V1/MachineType/Architecture.php | 71 + .../Compute/V1/MachineTypeAggregatedList.php | 320 + .../Cloud/Compute/V1/MachineTypeList.php | 287 + .../Compute/V1/MachineTypesScopedList.php | 110 + .../Cloud/Compute/V1/ManagedInstance.php | 515 ++ .../V1/ManagedInstance/CurrentAction.php | 130 + .../V1/ManagedInstance/InstanceStatus.php | 119 + .../V1/ManagedInstanceInstanceHealth.php | 124 + .../DetailedHealthState.php | 85 + .../Compute/V1/ManagedInstanceLastAttempt.php | 76 + ...nstancePropertiesFromFlexibilityPolicy.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 | 853 +++ .../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 | 331 + .../Cloud/Compute/V1/NetworkEndpointGroup.php | 856 +++ .../NetworkEndpointType.php | 106 + .../V1/NetworkEndpointGroupAggregatedList.php | 320 + .../V1/NetworkEndpointGroupAppEngine.php | 165 + .../V1/NetworkEndpointGroupCloudFunction.php | 121 + .../V1/NetworkEndpointGroupCloudRun.php | 165 + .../Compute/V1/NetworkEndpointGroupList.php | 286 + .../V1/NetworkEndpointGroupPscData.php | 213 + .../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 | 92 + .../Compute/V1/NetworkInterface/StackType.php | 76 + .../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/NetworkProfile.php | 473 ++ .../Compute/V1/NetworkProfileLocation.php | 117 + .../V1/NetworkProfileLocation/Scope.php | 59 + .../V1/NetworkProfileNetworkFeatures.php | 1048 +++ .../AddressPurposes.php | 105 + .../AllowAliasIpRanges.php | 60 + .../AllowAutoModeSubnet.php | 60 + .../AllowClassDFirewalls.php | 60 + .../AllowCloudNat.php | 60 + .../AllowCloudRouter.php | 60 + .../AllowExternalIpAccess.php | 60 + .../AllowInterconnect.php | 60 + .../AllowLoadBalancing.php | 60 + .../AllowMultiNicInSameNetwork.php | 60 + .../AllowPacketMirroring.php | 60 + .../AllowPrivateGoogleAccess.php | 60 + .../AllowPsc.php | 60 + .../AllowSameNetworkUnicast.php | 60 + .../AllowStaticRoutes.php | 60 + .../AllowSubInterfaces.php | 60 + .../AllowVpcPeering.php | 60 + .../AllowVpn.php | 60 + .../InterfaceTypes.php | 91 + .../SubnetPurposes.php | 59 + .../SubnetStackTypes.php | 64 + .../NetworkProfileNetworkFeatures/Unicast.php | 60 + .../V1/NetworkProfilesListResponse.php | 358 + .../Cloud/Compute/V1/NetworkRoutingConfig.php | 221 + .../BgpBestPathSelectionMode.php | 60 + .../BgpInterRegionCost.php | 64 + .../V1/NetworkRoutingConfig/RoutingMode.php | 64 + .../Compute/V1/NetworksAddPeeringRequest.php | 208 + .../NetworksGetEffectiveFirewallsResponse.php | 100 + ...rewallsResponseEffectiveFirewallPolicy.php | 290 + .../Type.php | 70 + .../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 | 409 ++ .../src/Google/Cloud/Compute/V1/PathRule.php | 243 + .../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 | 226 + .../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 | 874 +++ .../Cloud/Compute/V1/QuotaExceededInfo.php | 291 + .../V1/QuotaExceededInfo/RolloutStatus.php | 64 + .../Cloud/Compute/V1/QuotaStatusWarning.php | 159 + .../Compute/V1/QuotaStatusWarning/Code.php | 253 + .../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 + ...nceGroupManagersResumeInstancesRequest.php | 66 + ...anceGroupManagersSetTargetPoolsRequest.php | 110 + ...nstanceGroupManagersSetTemplateRequest.php | 76 + ...anceGroupManagersStartInstancesRequest.php | 66 + ...tanceGroupManagersStopInstancesRequest.php | 110 + ...ceGroupManagersSuspendInstancesRequest.php | 110 + .../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 | 151 + .../Compute/V1/ResourceStatusScheduling.php | 76 + .../Compute/V1/ResumeInstanceRequest.php | 196 + ...meInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../src/Google/Cloud/Compute/V1/Route.php | 1115 ++++ .../Cloud/Compute/V1/Route/NextHopOrigin.php | 65 + .../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 + .../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 | 600 ++ .../Scheduling/InstanceTerminationAction.php | 71 + .../V1/Scheduling/OnHostMaintenance.php | 64 + .../V1/Scheduling/ProvisioningModel.php | 64 + .../Compute/V1/SchedulingNodeAffinity.php | 159 + .../V1/SchedulingNodeAffinity/Operator.php | 69 + .../V1/SchedulingOnInstanceStopAction.php | 77 + .../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 | 369 + ...hresholdConfigTrafficGranularityConfig.php | 169 + .../Type.php | 65 + .../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 | 105 + ...RuleRateLimitOptionsEnforceOnKeyConfig.php | 124 + .../EnforceOnKeyType.php | 105 + ...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 | 867 +++ .../ConnectionPreference.php | 65 + .../V1/ServiceAttachmentAggregatedList.php | 321 + .../V1/ServiceAttachmentConnectedEndpoint.php | 257 + .../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 + .../SetLabelsRegionSecurityPolicyRequest.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 + ...rtInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../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 + ...opInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../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 | 110 + .../Cloud/Compute/V1/Subnetwork/Role.php | 64 + .../Cloud/Compute/V1/Subnetwork/StackType.php | 76 + .../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 + ...ndInstancesInstanceGroupManagerRequest.php | 242 + ...ancesRegionInstanceGroupManagerRequest.php | 242 + .../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 | 823 +++ .../V1/TargetHttpsProxy/QuicOverride.php | 71 + .../V1/TargetHttpsProxy/TlsEarlyData.php | 78 + .../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 | 113 + .../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 | 707 ++ .../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 | 110 + .../Compute/V1/UsableSubnetwork/Role.php | 64 + .../Compute/V1/UsableSubnetwork/StackType.php | 71 + .../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 | 71 + .../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 | 253 + .../src/Google/Cloud/Compute/V1/Warnings.php | 158 + .../Google/Cloud/Compute/V1/Warnings/Code.php | 253 + .../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 | 73 + .../samples/V1/AcceleratorTypesClient/get.php | 76 + .../V1/AcceleratorTypesClient/list.php | 76 + .../V1/AddressesClient/aggregated_list.php | 73 + .../V1/samples/V1/AddressesClient/delete.php | 85 + .../V1/samples/V1/AddressesClient/get.php | 76 + .../V1/samples/V1/AddressesClient/insert.php | 85 + .../V1/samples/V1/AddressesClient/list.php | 76 + .../V1/samples/V1/AddressesClient/move.php | 88 + .../samples/V1/AddressesClient/set_labels.php | 88 + .../V1/AutoscalersClient/aggregated_list.php | 73 + .../samples/V1/AutoscalersClient/delete.php | 85 + .../V1/samples/V1/AutoscalersClient/get.php | 76 + .../samples/V1/AutoscalersClient/insert.php | 85 + .../V1/samples/V1/AutoscalersClient/list.php | 76 + .../V1/samples/V1/AutoscalersClient/patch.php | 85 + .../samples/V1/AutoscalersClient/update.php | 85 + .../add_signed_url_key.php | 85 + .../V1/BackendBucketsClient/delete.php | 82 + .../delete_signed_url_key.php | 88 + .../samples/V1/BackendBucketsClient/get.php | 73 + .../BackendBucketsClient/get_iam_policy.php | 73 + .../V1/BackendBucketsClient/insert.php | 82 + .../samples/V1/BackendBucketsClient/list.php | 73 + .../samples/V1/BackendBucketsClient/patch.php | 85 + .../set_edge_security_policy.php | 85 + .../BackendBucketsClient/set_iam_policy.php | 76 + .../test_iam_permissions.php | 76 + .../V1/BackendBucketsClient/update.php | 85 + .../add_signed_url_key.php | 85 + .../BackendServicesClient/aggregated_list.php | 73 + .../V1/BackendServicesClient/delete.php | 82 + .../delete_signed_url_key.php | 88 + .../samples/V1/BackendServicesClient/get.php | 73 + .../V1/BackendServicesClient/get_health.php | 76 + .../BackendServicesClient/get_iam_policy.php | 73 + .../V1/BackendServicesClient/insert.php | 82 + .../samples/V1/BackendServicesClient/list.php | 73 + .../V1/BackendServicesClient/list_usable.php | 73 + .../V1/BackendServicesClient/patch.php | 85 + .../set_edge_security_policy.php | 85 + .../BackendServicesClient/set_iam_policy.php | 76 + .../set_security_policy.php | 85 + .../test_iam_permissions.php | 76 + .../V1/BackendServicesClient/update.php | 85 + .../V1/DiskTypesClient/aggregated_list.php | 73 + .../V1/samples/V1/DiskTypesClient/get.php | 76 + .../V1/samples/V1/DiskTypesClient/list.php | 76 + .../V1/DisksClient/add_resource_policies.php | 88 + .../V1/DisksClient/aggregated_list.php | 73 + .../V1/samples/V1/DisksClient/bulk_insert.php | 85 + .../V1/DisksClient/create_snapshot.php | 88 + .../V1/samples/V1/DisksClient/delete.php | 85 + .../Compute/V1/samples/V1/DisksClient/get.php | 76 + .../samples/V1/DisksClient/get_iam_policy.php | 76 + .../V1/samples/V1/DisksClient/insert.php | 85 + .../V1/samples/V1/DisksClient/list.php | 76 + .../DisksClient/remove_resource_policies.php | 88 + .../V1/samples/V1/DisksClient/resize.php | 88 + .../samples/V1/DisksClient/set_iam_policy.php | 79 + .../V1/samples/V1/DisksClient/set_labels.php | 88 + .../DisksClient/start_async_replication.php | 88 + .../V1/DisksClient/stop_async_replication.php | 85 + .../stop_group_async_replication.php | 85 + .../V1/DisksClient/test_iam_permissions.php | 79 + .../V1/samples/V1/DisksClient/update.php | 88 + .../V1/ExternalVpnGatewaysClient/delete.php | 82 + .../V1/ExternalVpnGatewaysClient/get.php | 73 + .../V1/ExternalVpnGatewaysClient/insert.php | 82 + .../V1/ExternalVpnGatewaysClient/list.php | 73 + .../ExternalVpnGatewaysClient/set_labels.php | 85 + .../test_iam_permissions.php | 76 + .../add_association.php | 82 + .../V1/FirewallPoliciesClient/add_rule.php | 82 + .../V1/FirewallPoliciesClient/clone_rules.php | 79 + .../V1/FirewallPoliciesClient/delete.php | 79 + .../samples/V1/FirewallPoliciesClient/get.php | 70 + .../get_association.php | 70 + .../FirewallPoliciesClient/get_iam_policy.php | 70 + .../V1/FirewallPoliciesClient/get_rule.php | 70 + .../V1/FirewallPoliciesClient/insert.php | 82 + .../V1/FirewallPoliciesClient/list.php | 60 + .../list_associations.php | 57 + .../V1/FirewallPoliciesClient/move.php | 82 + .../V1/FirewallPoliciesClient/patch.php | 82 + .../V1/FirewallPoliciesClient/patch_rule.php | 82 + .../remove_association.php | 79 + .../V1/FirewallPoliciesClient/remove_rule.php | 79 + .../FirewallPoliciesClient/set_iam_policy.php | 73 + .../test_iam_permissions.php | 73 + .../V1/samples/V1/FirewallsClient/delete.php | 82 + .../V1/samples/V1/FirewallsClient/get.php | 73 + .../V1/samples/V1/FirewallsClient/insert.php | 82 + .../V1/samples/V1/FirewallsClient/list.php | 73 + .../V1/samples/V1/FirewallsClient/patch.php | 85 + .../V1/samples/V1/FirewallsClient/update.php | 85 + .../ForwardingRulesClient/aggregated_list.php | 73 + .../V1/ForwardingRulesClient/delete.php | 85 + .../samples/V1/ForwardingRulesClient/get.php | 76 + .../V1/ForwardingRulesClient/insert.php | 85 + .../samples/V1/ForwardingRulesClient/list.php | 76 + .../V1/ForwardingRulesClient/patch.php | 88 + .../V1/ForwardingRulesClient/set_labels.php | 88 + .../V1/ForwardingRulesClient/set_target.php | 88 + .../V1/GlobalAddressesClient/delete.php | 82 + .../samples/V1/GlobalAddressesClient/get.php | 73 + .../V1/GlobalAddressesClient/insert.php | 82 + .../samples/V1/GlobalAddressesClient/list.php | 73 + .../samples/V1/GlobalAddressesClient/move.php | 85 + .../V1/GlobalAddressesClient/set_labels.php | 85 + .../V1/GlobalForwardingRulesClient/delete.php | 82 + .../V1/GlobalForwardingRulesClient/get.php | 73 + .../V1/GlobalForwardingRulesClient/insert.php | 82 + .../V1/GlobalForwardingRulesClient/list.php | 73 + .../V1/GlobalForwardingRulesClient/patch.php | 85 + .../set_labels.php | 85 + .../set_target.php | 85 + .../attach_network_endpoints.php | 87 + .../delete.php | 82 + .../detach_network_endpoints.php | 87 + .../GlobalNetworkEndpointGroupsClient/get.php | 73 + .../insert.php | 82 + .../list.php | 73 + .../list_network_endpoints.php | 76 + .../aggregated_list.php | 73 + .../V1/GlobalOperationsClient/delete.php | 73 + .../samples/V1/GlobalOperationsClient/get.php | 73 + .../V1/GlobalOperationsClient/list.php | 73 + .../V1/GlobalOperationsClient/wait.php | 73 + .../delete.php | 70 + .../get.php | 70 + .../list.php | 60 + .../delete.php | 82 + .../get.php | 73 + .../insert.php | 82 + .../list.php | 73 + .../patch.php | 85 + .../V1/HealthChecksClient/aggregated_list.php | 73 + .../samples/V1/HealthChecksClient/delete.php | 82 + .../V1/samples/V1/HealthChecksClient/get.php | 73 + .../samples/V1/HealthChecksClient/insert.php | 82 + .../V1/samples/V1/HealthChecksClient/list.php | 73 + .../samples/V1/HealthChecksClient/patch.php | 85 + .../samples/V1/HealthChecksClient/update.php | 85 + .../samples/V1/ImageFamilyViewsClient/get.php | 76 + .../V1/samples/V1/ImagesClient/delete.php | 82 + .../V1/samples/V1/ImagesClient/deprecate.php | 85 + .../V1/samples/V1/ImagesClient/get.php | 73 + .../V1/ImagesClient/get_from_family.php | 73 + .../V1/ImagesClient/get_iam_policy.php | 73 + .../V1/samples/V1/ImagesClient/insert.php | 82 + .../V1/samples/V1/ImagesClient/list.php | 73 + .../V1/samples/V1/ImagesClient/patch.php | 85 + .../V1/ImagesClient/set_iam_policy.php | 76 + .../V1/samples/V1/ImagesClient/set_labels.php | 85 + .../V1/ImagesClient/test_iam_permissions.php | 76 + .../cancel.php | 92 + .../delete.php | 92 + .../get.php | 83 + .../insert.php | 88 + .../list.php | 79 + .../abandon_instances.php | 93 + .../aggregated_list.php | 73 + .../apply_updates_to_instances.php | 93 + .../create_instances.php | 93 + .../V1/InstanceGroupManagersClient/delete.php | 85 + .../delete_instances.php | 93 + .../delete_per_instance_configs.php | 93 + .../V1/InstanceGroupManagersClient/get.php | 76 + .../V1/InstanceGroupManagersClient/insert.php | 85 + .../V1/InstanceGroupManagersClient/list.php | 76 + .../list_errors.php | 79 + .../list_managed_instances.php | 82 + .../list_per_instance_configs.php | 82 + .../V1/InstanceGroupManagersClient/patch.php | 88 + .../patch_per_instance_configs.php | 93 + .../recreate_instances.php | 93 + .../V1/InstanceGroupManagersClient/resize.php | 92 + .../resume_instances.php | 93 + .../set_instance_template.php | 93 + .../set_target_pools.php | 93 + .../start_instances.php | 90 + .../stop_instances.php | 90 + .../suspend_instances.php | 93 + .../update_per_instance_configs.php | 93 + .../V1/InstanceGroupsClient/add_instances.php | 88 + .../InstanceGroupsClient/aggregated_list.php | 73 + .../V1/InstanceGroupsClient/delete.php | 85 + .../samples/V1/InstanceGroupsClient/get.php | 76 + .../V1/InstanceGroupsClient/insert.php | 85 + .../samples/V1/InstanceGroupsClient/list.php | 76 + .../InstanceGroupsClient/list_instances.php | 82 + .../InstanceGroupsClient/remove_instances.php | 88 + .../InstanceGroupsClient/set_named_ports.php | 88 + .../V1/InstanceSettingsServiceClient/get.php | 73 + .../InstanceSettingsServiceClient/patch.php | 85 + .../aggregated_list.php | 73 + .../V1/InstanceTemplatesClient/delete.php | 82 + .../V1/InstanceTemplatesClient/get.php | 73 + .../get_iam_policy.php | 73 + .../V1/InstanceTemplatesClient/insert.php | 82 + .../V1/InstanceTemplatesClient/list.php | 73 + .../set_iam_policy.php | 76 + .../test_iam_permissions.php | 76 + .../V1/InstancesClient/add_access_config.php | 95 + .../InstancesClient/add_resource_policies.php | 88 + .../V1/InstancesClient/aggregated_list.php | 73 + .../V1/InstancesClient/attach_disk.php | 88 + .../V1/InstancesClient/bulk_insert.php | 85 + .../V1/samples/V1/InstancesClient/delete.php | 85 + .../InstancesClient/delete_access_config.php | 96 + .../V1/InstancesClient/detach_disk.php | 92 + .../V1/samples/V1/InstancesClient/get.php | 76 + .../get_effective_firewalls.php | 83 + .../InstancesClient/get_guest_attributes.php | 76 + .../V1/InstancesClient/get_iam_policy.php | 76 + .../V1/InstancesClient/get_screenshot.php | 76 + .../get_serial_port_output.php | 76 + .../get_shielded_instance_identity.php | 79 + .../V1/samples/V1/InstancesClient/insert.php | 85 + .../V1/samples/V1/InstancesClient/list.php | 76 + .../V1/InstancesClient/list_referrers.php | 79 + .../InstancesClient/perform_maintenance.php | 85 + .../remove_resource_policies.php | 88 + .../V1/samples/V1/InstancesClient/reset.php | 85 + .../V1/samples/V1/InstancesClient/resume.php | 85 + .../send_diagnostic_interrupt.php | 76 + .../set_deletion_protection.php | 85 + .../InstancesClient/set_disk_auto_delete.php | 96 + .../V1/InstancesClient/set_iam_policy.php | 79 + .../samples/V1/InstancesClient/set_labels.php | 88 + .../InstancesClient/set_machine_resources.php | 88 + .../V1/InstancesClient/set_machine_type.php | 88 + .../V1/InstancesClient/set_metadata.php | 88 + .../InstancesClient/set_min_cpu_platform.php | 88 + .../samples/V1/InstancesClient/set_name.php | 88 + .../V1/InstancesClient/set_scheduling.php | 88 + .../InstancesClient/set_security_policy.php | 88 + .../InstancesClient/set_service_account.php | 88 + ...set_shielded_instance_integrity_policy.php | 91 + .../samples/V1/InstancesClient/set_tags.php | 88 + .../simulate_maintenance_event.php | 85 + .../V1/samples/V1/InstancesClient/start.php | 85 + .../start_with_encryption_key.php | 88 + .../V1/samples/V1/InstancesClient/stop.php | 85 + .../V1/samples/V1/InstancesClient/suspend.php | 85 + .../InstancesClient/test_iam_permissions.php | 79 + .../V1/samples/V1/InstancesClient/update.php | 88 + .../InstancesClient/update_access_config.php | 95 + .../InstancesClient/update_display_device.php | 88 + .../update_network_interface.php | 95 + .../update_shielded_instance_config.php | 91 + .../aggregated_list.php | 73 + .../V1/InstantSnapshotsClient/delete.php | 85 + .../samples/V1/InstantSnapshotsClient/get.php | 76 + .../InstantSnapshotsClient/get_iam_policy.php | 76 + .../V1/InstantSnapshotsClient/insert.php | 85 + .../V1/InstantSnapshotsClient/list.php | 76 + .../InstantSnapshotsClient/set_iam_policy.php | 79 + .../V1/InstantSnapshotsClient/set_labels.php | 88 + .../test_iam_permissions.php | 79 + .../aggregated_list.php | 73 + .../InterconnectAttachmentsClient/delete.php | 85 + .../V1/InterconnectAttachmentsClient/get.php | 76 + .../InterconnectAttachmentsClient/insert.php | 85 + .../V1/InterconnectAttachmentsClient/list.php | 76 + .../InterconnectAttachmentsClient/patch.php | 88 + .../set_labels.php | 88 + .../V1/InterconnectLocationsClient/get.php | 73 + .../V1/InterconnectLocationsClient/list.php | 73 + .../InterconnectRemoteLocationsClient/get.php | 73 + .../list.php | 73 + .../samples/V1/InterconnectsClient/delete.php | 82 + .../V1/samples/V1/InterconnectsClient/get.php | 73 + .../InterconnectsClient/get_diagnostics.php | 73 + .../InterconnectsClient/get_macsec_config.php | 73 + .../samples/V1/InterconnectsClient/insert.php | 82 + .../samples/V1/InterconnectsClient/list.php | 73 + .../samples/V1/InterconnectsClient/patch.php | 85 + .../V1/InterconnectsClient/set_labels.php | 85 + .../V1/samples/V1/LicenseCodesClient/get.php | 73 + .../test_iam_permissions.php | 76 + .../V1/samples/V1/LicensesClient/delete.php | 82 + .../V1/samples/V1/LicensesClient/get.php | 73 + .../V1/LicensesClient/get_iam_policy.php | 73 + .../V1/samples/V1/LicensesClient/insert.php | 82 + .../V1/samples/V1/LicensesClient/list.php | 73 + .../V1/LicensesClient/set_iam_policy.php | 76 + .../LicensesClient/test_iam_permissions.php | 76 + .../samples/V1/MachineImagesClient/delete.php | 82 + .../V1/samples/V1/MachineImagesClient/get.php | 73 + .../V1/MachineImagesClient/get_iam_policy.php | 73 + .../samples/V1/MachineImagesClient/insert.php | 82 + .../samples/V1/MachineImagesClient/list.php | 73 + .../V1/MachineImagesClient/set_iam_policy.php | 76 + .../test_iam_permissions.php | 76 + .../V1/MachineTypesClient/aggregated_list.php | 73 + .../V1/samples/V1/MachineTypesClient/get.php | 76 + .../V1/samples/V1/MachineTypesClient/list.php | 76 + .../aggregated_list.php | 73 + .../V1/NetworkAttachmentsClient/delete.php | 85 + .../V1/NetworkAttachmentsClient/get.php | 76 + .../get_iam_policy.php | 76 + .../V1/NetworkAttachmentsClient/insert.php | 85 + .../V1/NetworkAttachmentsClient/list.php | 76 + .../V1/NetworkAttachmentsClient/patch.php | 88 + .../set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../aggregated_list.php | 73 + .../delete.php | 85 + .../NetworkEdgeSecurityServicesClient/get.php | 76 + .../insert.php | 85 + .../patch.php | 88 + .../aggregated_list.php | 73 + .../attach_network_endpoints.php | 93 + .../V1/NetworkEndpointGroupsClient/delete.php | 85 + .../detach_network_endpoints.php | 93 + .../V1/NetworkEndpointGroupsClient/get.php | 76 + .../V1/NetworkEndpointGroupsClient/insert.php | 85 + .../V1/NetworkEndpointGroupsClient/list.php | 76 + .../list_network_endpoints.php | 87 + .../test_iam_permissions.php | 79 + .../add_association.php | 85 + .../add_rule.php | 85 + .../clone_rules.php | 82 + .../NetworkFirewallPoliciesClient/delete.php | 82 + .../V1/NetworkFirewallPoliciesClient/get.php | 73 + .../get_association.php | 73 + .../get_iam_policy.php | 73 + .../get_rule.php | 73 + .../NetworkFirewallPoliciesClient/insert.php | 82 + .../V1/NetworkFirewallPoliciesClient/list.php | 73 + .../NetworkFirewallPoliciesClient/patch.php | 85 + .../patch_rule.php | 85 + .../remove_association.php | 82 + .../remove_rule.php | 82 + .../set_iam_policy.php | 76 + .../test_iam_permissions.php | 76 + .../samples/V1/NetworkProfilesClient/get.php | 73 + .../samples/V1/NetworkProfilesClient/list.php | 70 + .../samples/V1/NetworksClient/add_peering.php | 85 + .../V1/samples/V1/NetworksClient/delete.php | 82 + .../V1/samples/V1/NetworksClient/get.php | 73 + .../get_effective_firewalls.php | 73 + .../V1/samples/V1/NetworksClient/insert.php | 82 + .../V1/samples/V1/NetworksClient/list.php | 73 + .../V1/NetworksClient/list_peering_routes.php | 76 + .../V1/samples/V1/NetworksClient/patch.php | 85 + .../V1/NetworksClient/remove_peering.php | 85 + .../NetworksClient/switch_to_custom_mode.php | 82 + .../V1/NetworksClient/update_peering.php | 85 + .../samples/V1/NodeGroupsClient/add_nodes.php | 88 + .../V1/NodeGroupsClient/aggregated_list.php | 73 + .../V1/samples/V1/NodeGroupsClient/delete.php | 85 + .../V1/NodeGroupsClient/delete_nodes.php | 88 + .../V1/samples/V1/NodeGroupsClient/get.php | 76 + .../V1/NodeGroupsClient/get_iam_policy.php | 76 + .../V1/samples/V1/NodeGroupsClient/insert.php | 88 + .../V1/samples/V1/NodeGroupsClient/list.php | 76 + .../V1/NodeGroupsClient/list_nodes.php | 79 + .../V1/samples/V1/NodeGroupsClient/patch.php | 88 + .../NodeGroupsClient/perform_maintenance.php | 88 + .../V1/NodeGroupsClient/set_iam_policy.php | 79 + .../V1/NodeGroupsClient/set_node_template.php | 88 + .../simulate_maintenance_event.php | 90 + .../NodeGroupsClient/test_iam_permissions.php | 79 + .../NodeTemplatesClient/aggregated_list.php | 73 + .../samples/V1/NodeTemplatesClient/delete.php | 85 + .../V1/samples/V1/NodeTemplatesClient/get.php | 76 + .../V1/NodeTemplatesClient/get_iam_policy.php | 76 + .../samples/V1/NodeTemplatesClient/insert.php | 85 + .../samples/V1/NodeTemplatesClient/list.php | 76 + .../V1/NodeTemplatesClient/set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../V1/NodeTypesClient/aggregated_list.php | 73 + .../V1/samples/V1/NodeTypesClient/get.php | 76 + .../V1/samples/V1/NodeTypesClient/list.php | 76 + .../aggregated_list.php | 73 + .../V1/PacketMirroringsClient/delete.php | 85 + .../samples/V1/PacketMirroringsClient/get.php | 76 + .../V1/PacketMirroringsClient/insert.php | 85 + .../V1/PacketMirroringsClient/list.php | 76 + .../V1/PacketMirroringsClient/patch.php | 88 + .../test_iam_permissions.php | 79 + .../V1/ProjectsClient/disable_xpn_host.php | 79 + .../ProjectsClient/disable_xpn_resource.php | 82 + .../V1/ProjectsClient/enable_xpn_host.php | 79 + .../V1/ProjectsClient/enable_xpn_resource.php | 82 + .../V1/samples/V1/ProjectsClient/get.php | 70 + .../V1/ProjectsClient/get_xpn_host.php | 70 + .../V1/ProjectsClient/get_xpn_resources.php | 73 + .../V1/ProjectsClient/list_xpn_hosts.php | 76 + .../samples/V1/ProjectsClient/move_disk.php | 82 + .../V1/ProjectsClient/move_instance.php | 82 + .../ProjectsClient/set_cloud_armor_tier.php | 82 + .../set_common_instance_metadata.php | 82 + .../set_default_network_tier.php | 82 + .../set_usage_export_bucket.php | 82 + .../announce.php | 82 + .../PublicAdvertisedPrefixesClient/delete.php | 82 + .../V1/PublicAdvertisedPrefixesClient/get.php | 73 + .../PublicAdvertisedPrefixesClient/insert.php | 82 + .../PublicAdvertisedPrefixesClient/list.php | 73 + .../PublicAdvertisedPrefixesClient/patch.php | 85 + .../withdraw.php | 82 + .../aggregated_list.php | 73 + .../announce.php | 85 + .../PublicDelegatedPrefixesClient/delete.php | 85 + .../V1/PublicDelegatedPrefixesClient/get.php | 76 + .../PublicDelegatedPrefixesClient/insert.php | 85 + .../V1/PublicDelegatedPrefixesClient/list.php | 76 + .../PublicDelegatedPrefixesClient/patch.php | 88 + .../withdraw.php | 85 + .../V1/RegionAutoscalersClient/delete.php | 85 + .../V1/RegionAutoscalersClient/get.php | 76 + .../V1/RegionAutoscalersClient/insert.php | 85 + .../V1/RegionAutoscalersClient/list.php | 76 + .../V1/RegionAutoscalersClient/patch.php | 85 + .../V1/RegionAutoscalersClient/update.php | 85 + .../V1/RegionBackendServicesClient/delete.php | 85 + .../V1/RegionBackendServicesClient/get.php | 76 + .../get_health.php | 79 + .../get_iam_policy.php | 76 + .../V1/RegionBackendServicesClient/insert.php | 85 + .../V1/RegionBackendServicesClient/list.php | 76 + .../list_usable.php | 76 + .../V1/RegionBackendServicesClient/patch.php | 88 + .../set_iam_policy.php | 79 + .../set_security_policy.php | 88 + .../test_iam_permissions.php | 79 + .../V1/RegionBackendServicesClient/update.php | 88 + .../aggregated_list.php | 73 + .../V1/RegionCommitmentsClient/get.php | 76 + .../V1/RegionCommitmentsClient/insert.php | 85 + .../V1/RegionCommitmentsClient/list.php | 76 + .../V1/RegionCommitmentsClient/update.php | 88 + .../samples/V1/RegionDiskTypesClient/get.php | 76 + .../samples/V1/RegionDiskTypesClient/list.php | 76 + .../add_resource_policies.php | 88 + .../V1/RegionDisksClient/bulk_insert.php | 85 + .../V1/RegionDisksClient/create_snapshot.php | 88 + .../samples/V1/RegionDisksClient/delete.php | 85 + .../V1/samples/V1/RegionDisksClient/get.php | 76 + .../V1/RegionDisksClient/get_iam_policy.php | 76 + .../samples/V1/RegionDisksClient/insert.php | 85 + .../V1/samples/V1/RegionDisksClient/list.php | 76 + .../remove_resource_policies.php | 90 + .../samples/V1/RegionDisksClient/resize.php | 88 + .../V1/RegionDisksClient/set_iam_policy.php | 79 + .../V1/RegionDisksClient/set_labels.php | 88 + .../start_async_replication.php | 90 + .../stop_async_replication.php | 85 + .../stop_group_async_replication.php | 85 + .../test_iam_permissions.php | 79 + .../samples/V1/RegionDisksClient/update.php | 88 + .../delete.php | 85 + .../RegionHealthCheckServicesClient/get.php | 76 + .../insert.php | 85 + .../RegionHealthCheckServicesClient/list.php | 76 + .../RegionHealthCheckServicesClient/patch.php | 88 + .../V1/RegionHealthChecksClient/delete.php | 85 + .../V1/RegionHealthChecksClient/get.php | 76 + .../V1/RegionHealthChecksClient/insert.php | 85 + .../V1/RegionHealthChecksClient/list.php | 76 + .../V1/RegionHealthChecksClient/patch.php | 88 + .../V1/RegionHealthChecksClient/update.php | 88 + .../abandon_instances.php | 93 + .../apply_updates_to_instances.php | 93 + .../create_instances.php | 93 + .../delete.php | 85 + .../delete_instances.php | 93 + .../delete_per_instance_configs.php | 93 + .../RegionInstanceGroupManagersClient/get.php | 76 + .../insert.php | 85 + .../list.php | 76 + .../list_errors.php | 79 + .../list_managed_instances.php | 82 + .../list_per_instance_configs.php | 82 + .../patch.php | 88 + .../patch_per_instance_configs.php | 93 + .../recreate_instances.php | 93 + .../resize.php | 92 + .../resume_instances.php | 93 + .../set_instance_template.php | 93 + .../set_target_pools.php | 93 + .../start_instances.php | 93 + .../stop_instances.php | 93 + .../suspend_instances.php | 93 + .../update_per_instance_configs.php | 93 + .../V1/RegionInstanceGroupsClient/get.php | 76 + .../V1/RegionInstanceGroupsClient/list.php | 76 + .../list_instances.php | 84 + .../set_named_ports.php | 90 + .../RegionInstanceTemplatesClient/delete.php | 85 + .../V1/RegionInstanceTemplatesClient/get.php | 76 + .../RegionInstanceTemplatesClient/insert.php | 85 + .../V1/RegionInstanceTemplatesClient/list.php | 76 + .../V1/RegionInstancesClient/bulk_insert.php | 85 + .../RegionInstantSnapshotsClient/delete.php | 85 + .../V1/RegionInstantSnapshotsClient/get.php | 76 + .../get_iam_policy.php | 76 + .../RegionInstantSnapshotsClient/insert.php | 85 + .../V1/RegionInstantSnapshotsClient/list.php | 76 + .../set_iam_policy.php | 79 + .../set_labels.php | 88 + .../test_iam_permissions.php | 79 + .../attach_network_endpoints.php | 93 + .../delete.php | 85 + .../detach_network_endpoints.php | 93 + .../RegionNetworkEndpointGroupsClient/get.php | 76 + .../insert.php | 85 + .../list.php | 76 + .../list_network_endpoints.php | 82 + .../add_association.php | 88 + .../add_rule.php | 88 + .../clone_rules.php | 85 + .../delete.php | 85 + .../get.php | 76 + .../get_association.php | 76 + .../get_effective_firewalls.php | 76 + .../get_iam_policy.php | 76 + .../get_rule.php | 76 + .../insert.php | 85 + .../list.php | 76 + .../patch.php | 88 + .../patch_rule.php | 88 + .../remove_association.php | 85 + .../remove_rule.php | 85 + .../set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../delete.php | 85 + .../RegionNotificationEndpointsClient/get.php | 76 + .../insert.php | 85 + .../list.php | 76 + .../V1/RegionOperationsClient/delete.php | 76 + .../samples/V1/RegionOperationsClient/get.php | 76 + .../V1/RegionOperationsClient/list.php | 76 + .../V1/RegionOperationsClient/wait.php | 76 + .../RegionSecurityPoliciesClient/add_rule.php | 88 + .../RegionSecurityPoliciesClient/delete.php | 85 + .../V1/RegionSecurityPoliciesClient/get.php | 76 + .../RegionSecurityPoliciesClient/get_rule.php | 76 + .../RegionSecurityPoliciesClient/insert.php | 85 + .../V1/RegionSecurityPoliciesClient/list.php | 76 + .../V1/RegionSecurityPoliciesClient/patch.php | 88 + .../patch_rule.php | 88 + .../remove_rule.php | 85 + .../set_labels.php | 88 + .../V1/RegionSslCertificatesClient/delete.php | 85 + .../V1/RegionSslCertificatesClient/get.php | 76 + .../V1/RegionSslCertificatesClient/insert.php | 85 + .../V1/RegionSslCertificatesClient/list.php | 76 + .../V1/RegionSslPoliciesClient/delete.php | 85 + .../V1/RegionSslPoliciesClient/get.php | 76 + .../V1/RegionSslPoliciesClient/insert.php | 85 + .../V1/RegionSslPoliciesClient/list.php | 76 + .../list_available_features.php | 73 + .../V1/RegionSslPoliciesClient/patch.php | 88 + .../RegionTargetHttpProxiesClient/delete.php | 85 + .../V1/RegionTargetHttpProxiesClient/get.php | 76 + .../RegionTargetHttpProxiesClient/insert.php | 85 + .../V1/RegionTargetHttpProxiesClient/list.php | 76 + .../set_url_map.php | 88 + .../RegionTargetHttpsProxiesClient/delete.php | 85 + .../V1/RegionTargetHttpsProxiesClient/get.php | 76 + .../RegionTargetHttpsProxiesClient/insert.php | 85 + .../RegionTargetHttpsProxiesClient/list.php | 76 + .../RegionTargetHttpsProxiesClient/patch.php | 88 + .../set_ssl_certificates.php | 93 + .../set_url_map.php | 88 + .../RegionTargetTcpProxiesClient/delete.php | 85 + .../V1/RegionTargetTcpProxiesClient/get.php | 76 + .../RegionTargetTcpProxiesClient/insert.php | 85 + .../V1/RegionTargetTcpProxiesClient/list.php | 76 + .../samples/V1/RegionUrlMapsClient/delete.php | 85 + .../V1/samples/V1/RegionUrlMapsClient/get.php | 76 + .../samples/V1/RegionUrlMapsClient/insert.php | 85 + .../samples/V1/RegionUrlMapsClient/list.php | 76 + .../samples/V1/RegionUrlMapsClient/patch.php | 88 + .../samples/V1/RegionUrlMapsClient/update.php | 88 + .../V1/RegionUrlMapsClient/validate.php | 79 + .../V1/samples/V1/RegionZonesClient/list.php | 76 + .../V1/samples/V1/RegionsClient/get.php | 73 + .../V1/samples/V1/RegionsClient/list.php | 73 + .../V1/ReservationsClient/aggregated_list.php | 73 + .../samples/V1/ReservationsClient/delete.php | 85 + .../V1/samples/V1/ReservationsClient/get.php | 76 + .../V1/ReservationsClient/get_iam_policy.php | 76 + .../samples/V1/ReservationsClient/insert.php | 85 + .../V1/samples/V1/ReservationsClient/list.php | 76 + .../samples/V1/ReservationsClient/resize.php | 88 + .../V1/ReservationsClient/set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../samples/V1/ReservationsClient/update.php | 88 + .../aggregated_list.php | 73 + .../V1/ResourcePoliciesClient/delete.php | 85 + .../samples/V1/ResourcePoliciesClient/get.php | 76 + .../ResourcePoliciesClient/get_iam_policy.php | 76 + .../V1/ResourcePoliciesClient/insert.php | 85 + .../V1/ResourcePoliciesClient/list.php | 76 + .../V1/ResourcePoliciesClient/patch.php | 88 + .../ResourcePoliciesClient/set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../V1/RoutersClient/aggregated_list.php | 73 + .../V1/samples/V1/RoutersClient/delete.php | 85 + .../V1/samples/V1/RoutersClient/get.php | 76 + .../V1/RoutersClient/get_nat_ip_info.php | 76 + .../V1/RoutersClient/get_nat_mapping_info.php | 79 + .../V1/RoutersClient/get_router_status.php | 76 + .../V1/samples/V1/RoutersClient/insert.php | 85 + .../V1/samples/V1/RoutersClient/list.php | 76 + .../V1/samples/V1/RoutersClient/patch.php | 88 + .../V1/samples/V1/RoutersClient/preview.php | 79 + .../V1/samples/V1/RoutersClient/update.php | 88 + .../V1/samples/V1/RoutesClient/delete.php | 82 + .../V1/samples/V1/RoutesClient/get.php | 73 + .../V1/samples/V1/RoutesClient/insert.php | 82 + .../V1/samples/V1/RoutesClient/list.php | 73 + .../V1/SecurityPoliciesClient/add_rule.php | 85 + .../aggregated_list.php | 73 + .../V1/SecurityPoliciesClient/delete.php | 82 + .../samples/V1/SecurityPoliciesClient/get.php | 73 + .../V1/SecurityPoliciesClient/get_rule.php | 73 + .../V1/SecurityPoliciesClient/insert.php | 82 + .../V1/SecurityPoliciesClient/list.php | 73 + .../list_preconfigured_expression_sets.php | 70 + .../V1/SecurityPoliciesClient/patch.php | 85 + .../V1/SecurityPoliciesClient/patch_rule.php | 85 + .../V1/SecurityPoliciesClient/remove_rule.php | 82 + .../V1/SecurityPoliciesClient/set_labels.php | 85 + .../aggregated_list.php | 73 + .../V1/ServiceAttachmentsClient/delete.php | 85 + .../V1/ServiceAttachmentsClient/get.php | 76 + .../get_iam_policy.php | 76 + .../V1/ServiceAttachmentsClient/insert.php | 85 + .../V1/ServiceAttachmentsClient/list.php | 76 + .../V1/ServiceAttachmentsClient/patch.php | 88 + .../set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../V1/SnapshotSettingsServiceClient/get.php | 70 + .../SnapshotSettingsServiceClient/patch.php | 82 + .../V1/samples/V1/SnapshotsClient/delete.php | 82 + .../V1/samples/V1/SnapshotsClient/get.php | 73 + .../V1/SnapshotsClient/get_iam_policy.php | 73 + .../V1/samples/V1/SnapshotsClient/insert.php | 82 + .../V1/samples/V1/SnapshotsClient/list.php | 73 + .../V1/SnapshotsClient/set_iam_policy.php | 76 + .../samples/V1/SnapshotsClient/set_labels.php | 85 + .../SnapshotsClient/test_iam_permissions.php | 76 + .../SslCertificatesClient/aggregated_list.php | 73 + .../V1/SslCertificatesClient/delete.php | 82 + .../samples/V1/SslCertificatesClient/get.php | 73 + .../V1/SslCertificatesClient/insert.php | 82 + .../samples/V1/SslCertificatesClient/list.php | 73 + .../V1/SslPoliciesClient/aggregated_list.php | 73 + .../samples/V1/SslPoliciesClient/delete.php | 82 + .../V1/samples/V1/SslPoliciesClient/get.php | 73 + .../samples/V1/SslPoliciesClient/insert.php | 82 + .../V1/samples/V1/SslPoliciesClient/list.php | 73 + .../list_available_features.php | 70 + .../V1/samples/V1/SslPoliciesClient/patch.php | 85 + .../aggregated_list.php | 73 + .../samples/V1/StoragePoolTypesClient/get.php | 76 + .../V1/StoragePoolTypesClient/list.php | 76 + .../V1/StoragePoolsClient/aggregated_list.php | 73 + .../samples/V1/StoragePoolsClient/delete.php | 85 + .../V1/samples/V1/StoragePoolsClient/get.php | 76 + .../V1/StoragePoolsClient/get_iam_policy.php | 76 + .../samples/V1/StoragePoolsClient/insert.php | 85 + .../V1/samples/V1/StoragePoolsClient/list.php | 73 + .../V1/StoragePoolsClient/list_disks.php | 76 + .../V1/StoragePoolsClient/set_iam_policy.php | 79 + .../test_iam_permissions.php | 79 + .../samples/V1/StoragePoolsClient/update.php | 88 + .../V1/SubnetworksClient/aggregated_list.php | 73 + .../samples/V1/SubnetworksClient/delete.php | 85 + .../expand_ip_cidr_range.php | 88 + .../V1/samples/V1/SubnetworksClient/get.php | 76 + .../V1/SubnetworksClient/get_iam_policy.php | 76 + .../samples/V1/SubnetworksClient/insert.php | 85 + .../V1/samples/V1/SubnetworksClient/list.php | 76 + .../V1/SubnetworksClient/list_usable.php | 73 + .../V1/samples/V1/SubnetworksClient/patch.php | 88 + .../V1/SubnetworksClient/set_iam_policy.php | 79 + .../set_private_ip_google_access.php | 93 + .../test_iam_permissions.php | 79 + .../V1/TargetGrpcProxiesClient/delete.php | 82 + .../V1/TargetGrpcProxiesClient/get.php | 73 + .../V1/TargetGrpcProxiesClient/insert.php | 82 + .../V1/TargetGrpcProxiesClient/list.php | 73 + .../V1/TargetGrpcProxiesClient/patch.php | 85 + .../aggregated_list.php | 73 + .../V1/TargetHttpProxiesClient/delete.php | 82 + .../V1/TargetHttpProxiesClient/get.php | 73 + .../V1/TargetHttpProxiesClient/insert.php | 82 + .../V1/TargetHttpProxiesClient/list.php | 73 + .../V1/TargetHttpProxiesClient/patch.php | 85 + .../TargetHttpProxiesClient/set_url_map.php | 85 + .../aggregated_list.php | 73 + .../V1/TargetHttpsProxiesClient/delete.php | 82 + .../V1/TargetHttpsProxiesClient/get.php | 73 + .../V1/TargetHttpsProxiesClient/insert.php | 82 + .../V1/TargetHttpsProxiesClient/list.php | 73 + .../V1/TargetHttpsProxiesClient/patch.php | 85 + .../set_certificate_map.php | 87 + .../set_quic_override.php | 87 + .../set_ssl_certificates.php | 87 + .../set_ssl_policy.php | 85 + .../TargetHttpsProxiesClient/set_url_map.php | 85 + .../TargetInstancesClient/aggregated_list.php | 73 + .../V1/TargetInstancesClient/delete.php | 85 + .../samples/V1/TargetInstancesClient/get.php | 76 + .../V1/TargetInstancesClient/insert.php | 85 + .../samples/V1/TargetInstancesClient/list.php | 76 + .../set_security_policy.php | 88 + .../V1/TargetPoolsClient/add_health_check.php | 88 + .../V1/TargetPoolsClient/add_instance.php | 88 + .../V1/TargetPoolsClient/aggregated_list.php | 73 + .../samples/V1/TargetPoolsClient/delete.php | 85 + .../V1/samples/V1/TargetPoolsClient/get.php | 76 + .../V1/TargetPoolsClient/get_health.php | 79 + .../samples/V1/TargetPoolsClient/insert.php | 85 + .../V1/samples/V1/TargetPoolsClient/list.php | 76 + .../TargetPoolsClient/remove_health_check.php | 88 + .../V1/TargetPoolsClient/remove_instance.php | 88 + .../V1/TargetPoolsClient/set_backup.php | 88 + .../TargetPoolsClient/set_security_policy.php | 88 + .../V1/TargetSslProxiesClient/delete.php | 82 + .../samples/V1/TargetSslProxiesClient/get.php | 73 + .../V1/TargetSslProxiesClient/insert.php | 82 + .../V1/TargetSslProxiesClient/list.php | 73 + .../set_backend_service.php | 87 + .../set_certificate_map.php | 87 + .../set_proxy_header.php | 85 + .../set_ssl_certificates.php | 87 + .../TargetSslProxiesClient/set_ssl_policy.php | 85 + .../aggregated_list.php | 73 + .../V1/TargetTcpProxiesClient/delete.php | 82 + .../samples/V1/TargetTcpProxiesClient/get.php | 73 + .../V1/TargetTcpProxiesClient/insert.php | 82 + .../V1/TargetTcpProxiesClient/list.php | 73 + .../set_backend_service.php | 87 + .../set_proxy_header.php | 85 + .../aggregated_list.php | 73 + .../V1/TargetVpnGatewaysClient/delete.php | 85 + .../V1/TargetVpnGatewaysClient/get.php | 76 + .../V1/TargetVpnGatewaysClient/insert.php | 85 + .../V1/TargetVpnGatewaysClient/list.php | 76 + .../V1/TargetVpnGatewaysClient/set_labels.php | 88 + .../V1/UrlMapsClient/aggregated_list.php | 73 + .../V1/samples/V1/UrlMapsClient/delete.php | 82 + .../V1/samples/V1/UrlMapsClient/get.php | 73 + .../V1/samples/V1/UrlMapsClient/insert.php | 82 + .../V1/UrlMapsClient/invalidate_cache.php | 85 + .../V1/samples/V1/UrlMapsClient/list.php | 73 + .../V1/samples/V1/UrlMapsClient/patch.php | 85 + .../V1/samples/V1/UrlMapsClient/update.php | 85 + .../V1/samples/V1/UrlMapsClient/validate.php | 76 + .../V1/VpnGatewaysClient/aggregated_list.php | 73 + .../samples/V1/VpnGatewaysClient/delete.php | 85 + .../V1/samples/V1/VpnGatewaysClient/get.php | 76 + .../V1/VpnGatewaysClient/get_status.php | 76 + .../samples/V1/VpnGatewaysClient/insert.php | 85 + .../V1/samples/V1/VpnGatewaysClient/list.php | 76 + .../V1/VpnGatewaysClient/set_labels.php | 88 + .../test_iam_permissions.php | 79 + .../V1/VpnTunnelsClient/aggregated_list.php | 73 + .../V1/samples/V1/VpnTunnelsClient/delete.php | 85 + .../V1/samples/V1/VpnTunnelsClient/get.php | 76 + .../V1/samples/V1/VpnTunnelsClient/insert.php | 85 + .../V1/samples/V1/VpnTunnelsClient/list.php | 76 + .../V1/VpnTunnelsClient/set_labels.php | 88 + .../V1/ZoneOperationsClient/delete.php | 76 + .../samples/V1/ZoneOperationsClient/get.php | 76 + .../samples/V1/ZoneOperationsClient/list.php | 76 + .../samples/V1/ZoneOperationsClient/wait.php | 76 + .../Compute/V1/samples/V1/ZonesClient/get.php | 73 + .../V1/samples/V1/ZonesClient/list.php | 73 + .../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 | 266 + .../V1/src/V1/Client/AddressesClient.php | 431 ++ .../V1/src/V1/Client/AutoscalersClient.php | 431 ++ .../V1/src/V1/Client/BackendBucketsClient.php | 572 ++ .../src/V1/Client/BackendServicesClient.php | 686 ++ .../V1/src/V1/Client/DiskTypesClient.php | 263 + .../Compute/V1/src/V1/Client/DisksClient.php | 741 ++ .../V1/Client/ExternalVpnGatewaysClient.php | 404 ++ .../src/V1/Client/FirewallPoliciesClient.php | 742 ++ .../V1/src/V1/Client/FirewallsClient.php | 402 ++ .../src/V1/Client/ForwardingRulesClient.php | 459 ++ .../src/V1/Client/GlobalAddressesClient.php | 402 ++ .../V1/Client/GlobalForwardingRulesClient.php | 430 ++ .../GlobalNetworkEndpointGroupsClient.php | 433 ++ .../src/V1/Client/GlobalOperationsClient.php | 319 + .../GlobalOrganizationOperationsClient.php | 263 + .../GlobalPublicDelegatedPrefixesClient.php | 374 ++ .../V1/src/V1/Client/HealthChecksClient.php | 430 ++ .../src/V1/Client/ImageFamilyViewsClient.php | 206 + .../Compute/V1/src/V1/Client/ImagesClient.php | 544 ++ ...stanceGroupManagerResizeRequestsClient.php | 380 ++ .../V1/Client/InstanceGroupManagersClient.php | 920 +++ .../V1/src/V1/Client/InstanceGroupsClient.php | 487 ++ .../Client/InstanceSettingsServiceClient.php | 290 + .../src/V1/Client/InstanceTemplatesClient.php | 460 ++ .../V1/src/V1/Client/InstancesClient.php | 1590 +++++ .../src/V1/Client/InstantSnapshotsClient.php | 489 ++ .../Client/InterconnectAttachmentsClient.php | 432 ++ .../V1/Client/InterconnectLocationsClient.php | 235 + .../InterconnectRemoteLocationsClient.php | 235 + .../V1/src/V1/Client/InterconnectsClient.php | 460 ++ .../V1/src/V1/Client/LicenseCodesClient.php | 235 + .../V1/src/V1/Client/LicensesClient.php | 432 ++ .../V1/src/V1/Client/MachineImagesClient.php | 432 ++ .../V1/src/V1/Client/MachineTypesClient.php | 263 + .../V1/Client/NetworkAttachmentsClient.php | 490 ++ .../NetworkEdgeSecurityServicesClient.php | 376 ++ .../V1/Client/NetworkEndpointGroupsClient.php | 492 ++ .../Client/NetworkFirewallPoliciesClient.php | 690 ++ .../src/V1/Client/NetworkProfilesClient.php | 235 + .../V1/src/V1/Client/NetworksClient.php | 543 ++ .../V1/src/V1/Client/NodeGroupsClient.php | 657 ++ .../V1/src/V1/Client/NodeTemplatesClient.php | 461 ++ .../V1/src/V1/Client/NodeTypesClient.php | 263 + .../src/V1/Client/PacketMirroringsClient.php | 432 ++ .../V1/src/V1/Client/ProjectsClient.php | 626 ++ .../Client/PublicAdvertisedPrefixesClient.php | 430 ++ .../Client/PublicDelegatedPrefixesClient.php | 460 ++ .../src/V1/Client/RegionAutoscalersClient.php | 403 ++ .../V1/Client/RegionBackendServicesClient.php | 576 ++ .../src/V1/Client/RegionCommitmentsClient.php | 375 ++ .../src/V1/Client/RegionDiskTypesClient.php | 235 + .../V1/src/V1/Client/RegionDisksClient.php | 714 ++ .../RegionHealthCheckServicesClient.php | 375 ++ .../V1/Client/RegionHealthChecksClient.php | 403 ++ .../RegionInstanceGroupManagersClient.php | 896 +++ .../V1/Client/RegionInstanceGroupsClient.php | 347 + .../Client/RegionInstanceTemplatesClient.php | 347 + .../src/V1/Client/RegionInstancesClient.php | 261 + .../Client/RegionInstantSnapshotsClient.php | 462 ++ .../RegionNetworkEndpointGroupsClient.php | 434 ++ .../RegionNetworkFirewallPoliciesClient.php | 728 ++ .../RegionNotificationEndpointsClient.php | 347 + .../src/V1/Client/RegionOperationsClient.php | 291 + .../Client/RegionSecurityPoliciesClient.php | 516 ++ .../V1/Client/RegionSslCertificatesClient.php | 347 + .../src/V1/Client/RegionSslPoliciesClient.php | 405 ++ .../Client/RegionTargetHttpProxiesClient.php | 375 ++ .../Client/RegionTargetHttpsProxiesClient.php | 432 ++ .../Client/RegionTargetTcpProxiesClient.php | 347 + .../V1/src/V1/Client/RegionUrlMapsClient.php | 432 ++ .../V1/src/V1/Client/RegionZonesClient.php | 206 + .../V1/src/V1/Client/RegionsClient.php | 235 + .../V1/src/V1/Client/ReservationsClient.php | 517 ++ .../src/V1/Client/ResourcePoliciesClient.php | 489 ++ .../V1/src/V1/Client/RoutersClient.php | 546 ++ .../Compute/V1/src/V1/Client/RoutesClient.php | 346 + .../src/V1/Client/SecurityPoliciesClient.php | 573 ++ .../V1/Client/ServiceAttachmentsClient.php | 490 ++ .../Client/SnapshotSettingsServiceClient.php | 289 + .../V1/src/V1/Client/SnapshotsClient.php | 460 ++ .../src/V1/Client/SslCertificatesClient.php | 374 ++ .../V1/src/V1/Client/SslPoliciesClient.php | 431 ++ .../src/V1/Client/StoragePoolTypesClient.php | 263 + .../V1/src/V1/Client/StoragePoolsClient.php | 519 ++ .../V1/src/V1/Client/SubnetworksClient.php | 573 ++ .../src/V1/Client/TargetGrpcProxiesClient.php | 374 ++ .../src/V1/Client/TargetHttpProxiesClient.php | 430 ++ .../V1/Client/TargetHttpsProxiesClient.php | 543 ++ .../src/V1/Client/TargetInstancesClient.php | 403 ++ .../V1/src/V1/Client/TargetPoolsClient.php | 572 ++ .../src/V1/Client/TargetSslProxiesClient.php | 486 ++ .../src/V1/Client/TargetTcpProxiesClient.php | 430 ++ .../src/V1/Client/TargetVpnGatewaysClient.php | 403 ++ .../V1/src/V1/Client/UrlMapsClient.php | 487 ++ .../V1/src/V1/Client/VpnGatewaysClient.php | 461 ++ .../V1/src/V1/Client/VpnTunnelsClient.php | 403 ++ .../V1/src/V1/Client/ZoneOperationsClient.php | 291 + .../Compute/V1/src/V1/Client/ZonesClient.php | 235 + .../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 + .../PerformanceMonitoringUnit.php | 44 + .../VmFamily.php | 44 + .../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 + .../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 + .../IpAddressSelectionPolicy.php | 43 + .../BackendService/LoadBalancingScheme.php | 47 + .../Enums/BackendService/LocalityLbPolicy.php | 50 + .../src/V1/Enums/BackendService/Protocol.php | 50 + .../Enums/BackendService/SessionAffinity.php | 52 + .../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 | 82 + .../ConfidentialInstanceType.php | 44 + .../src/V1/Enums/DeprecationStatus/State.php | 42 + .../V1/src/V1/Enums/Disk/AccessMode.php | 40 + .../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 | 60 + .../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 + .../V1/Enums/HealthStatus/Ipv6HealthState.php | 34 + .../src/V1/Enums/HealthStatus/WeightError.php | 42 + .../HealthState.php | 43 + .../Ipv6HealthState.php | 35 + .../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 + .../Mode.php | 38 + .../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 | 47 + .../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 + .../V1/src/V1/Enums/MachineImage/Status.php | 44 + .../src/V1/Enums/MachineType/Architecture.php | 40 + .../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 | 51 + .../PscConnectionStatus.php | 48 + .../HealthStatus.php | 40 + .../Enums/NetworkInterface/Ipv6AccessType.php | 40 + .../src/V1/Enums/NetworkInterface/NicType.php | 46 + .../V1/Enums/NetworkInterface/StackType.php | 42 + .../src/V1/Enums/NetworkPeering/StackType.php | 38 + .../V1/src/V1/Enums/NetworkPeering/State.php | 38 + .../TotalEgressBandwidthTier.php | 40 + .../V1/Enums/NetworkProfileLocation/Scope.php | 38 + .../AddressPurposes.php | 51 + .../AllowAliasIpRanges.php | 40 + .../AllowAutoModeSubnet.php | 40 + .../AllowClassDFirewalls.php | 40 + .../AllowCloudNat.php | 39 + .../AllowCloudRouter.php | 40 + .../AllowExternalIpAccess.php | 40 + .../AllowInterconnect.php | 40 + .../AllowLoadBalancing.php | 40 + .../AllowMultiNicInSameNetwork.php | 40 + .../AllowPacketMirroring.php | 40 + .../AllowPrivateGoogleAccess.php | 40 + .../AllowPsc.php | 38 + .../AllowSameNetworkUnicast.php | 40 + .../AllowStaticRoutes.php | 40 + .../AllowSubInterfaces.php | 40 + .../AllowVpcPeering.php | 39 + .../AllowVpn.php | 38 + .../InterfaceTypes.php | 47 + .../SubnetPurposes.php | 39 + .../SubnetStackTypes.php | 42 + .../NetworkProfileNetworkFeatures/Unicast.php | 38 + .../BgpBestPathSelectionMode.php | 40 + .../BgpInterRegionCost.php | 39 + .../NetworkRoutingConfig/RoutingMode.php | 38 + .../Type.php | 43 + .../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 | 362 + .../Enums/QuotaExceededInfo/RolloutStatus.php | 38 + .../src/V1/Enums/QuotaStatusWarning/Code.php | 92 + .../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/NextHopOrigin.php | 40 + .../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 + .../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 + .../Type.php | 41 + .../JsonParsing.php | 41 + .../LogLevel.php | 38 + .../DdosProtection.php | 39 + .../VersionedExpr.php | 37 + .../Op.php | 45 + .../EnforceOnKey.php | 57 + .../EnforceOnKeyType.php | 58 + .../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 | 50 + .../V1/src/V1/Enums/Subnetwork/Role.php | 38 + .../V1/src/V1/Enums/Subnetwork/StackType.php | 42 + .../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 + .../Enums/TargetHttpsProxy/TlsEarlyData.php | 42 + .../src/V1/Enums/TargetInstance/NatPolicy.php | 36 + .../V1/Enums/TargetPool/SessionAffinity.php | 52 + .../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 | 50 + .../V1/src/V1/Enums/UsableSubnetwork/Role.php | 38 + .../V1/Enums/UsableSubnetwork/StackType.php | 40 + .../V1/Enums/VpnGateway/GatewayIpVersion.php | 38 + .../V1/src/V1/Enums/VpnGateway/StackType.php | 40 + .../State.php | 39 + .../UnsatisfiedReason.php | 38 + .../V1/src/V1/Enums/VpnTunnel/Status.php | 60 + .../Compute/V1/src/V1/Enums/Warning/Code.php | 92 + .../Compute/V1/src/V1/Enums/Warnings/Code.php | 92 + .../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 | 794 +++ .../src/V1/Gapic/AutoscalersGapicClient.php | 796 +++ .../V1/Gapic/BackendBucketsGapicClient.php | 1060 +++ .../V1/Gapic/BackendServicesGapicClient.php | 1369 ++++ .../V1/src/V1/Gapic/DiskTypesGapicClient.php | 422 ++ .../V1/src/V1/Gapic/DisksGapicClient.php | 1626 +++++ .../Gapic/ExternalVpnGatewaysGapicClient.php | 649 ++ .../V1/Gapic/FirewallPoliciesGapicClient.php | 1382 ++++ .../V1/src/V1/Gapic/FirewallsGapicClient.php | 681 ++ .../V1/Gapic/ForwardingRulesGapicClient.php | 874 +++ .../V1/Gapic/GlobalAddressesGapicClient.php | 677 ++ .../GlobalForwardingRulesGapicClient.php | 753 +++ ...GlobalNetworkEndpointGroupsGapicClient.php | 774 +++ .../V1/Gapic/GlobalOperationsGapicClient.php | 502 ++ ...lobalOrganizationOperationsGapicClient.php | 351 + ...obalPublicDelegatedPrefixesGapicClient.php | 605 ++ .../src/V1/Gapic/HealthChecksGapicClient.php | 767 +++ .../V1/Gapic/ImageFamilyViewsGapicClient.php | 224 + .../V1/src/V1/Gapic/ImagesGapicClient.php | 951 +++ ...eGroupManagerResizeRequestsGapicClient.php | 645 ++ .../InstanceGroupManagersGapicClient.php | 2210 ++++++ .../V1/Gapic/InstanceGroupsGapicClient.php | 987 +++ .../InstanceSettingsServiceGapicClient.php | 358 + .../V1/Gapic/InstanceTemplatesGapicClient.php | 763 +++ .../V1/src/V1/Gapic/InstancesGapicClient.php | 3925 +++++++++++ .../V1/Gapic/InstantSnapshotsGapicClient.php | 873 +++ .../InterconnectAttachmentsGapicClient.php | 799 +++ .../InterconnectLocationsGapicClient.php | 305 + ...InterconnectRemoteLocationsGapicClient.php | 305 + .../src/V1/Gapic/InterconnectsGapicClient.php | 766 +++ .../src/V1/Gapic/LicenseCodesGapicClient.php | 268 + .../V1/src/V1/Gapic/LicensesGapicClient.php | 677 ++ .../src/V1/Gapic/MachineImagesGapicClient.php | 683 ++ .../src/V1/Gapic/MachineTypesGapicClient.php | 422 ++ .../Gapic/NetworkAttachmentsGapicClient.php | 872 +++ ...NetworkEdgeSecurityServicesGapicClient.php | 639 ++ .../NetworkEndpointGroupsGapicClient.php | 945 +++ .../NetworkFirewallPoliciesGapicClient.php | 1345 ++++ .../V1/Gapic/NetworkProfilesGapicClient.php | 290 + .../V1/src/V1/Gapic/NetworksGapicClient.php | 1064 +++ .../V1/src/V1/Gapic/NodeGroupsGapicClient.php | 1388 ++++ .../src/V1/Gapic/NodeTemplatesGapicClient.php | 792 +++ .../V1/src/V1/Gapic/NodeTypesGapicClient.php | 422 ++ .../V1/Gapic/PacketMirroringsGapicClient.php | 765 +++ .../V1/src/V1/Gapic/ProjectsGapicClient.php | 1231 ++++ .../PublicAdvertisedPrefixesGapicClient.php | 751 +++ .../PublicDelegatedPrefixesGapicClient.php | 866 +++ .../V1/Gapic/RegionAutoscalersGapicClient.php | 711 ++ .../RegionBackendServicesGapicClient.php | 1091 +++ .../V1/Gapic/RegionCommitmentsGapicClient.php | 646 ++ .../V1/Gapic/RegionDiskTypesGapicClient.php | 314 + .../src/V1/Gapic/RegionDisksGapicClient.php | 1522 +++++ .../RegionHealthCheckServicesGapicClient.php | 627 ++ .../Gapic/RegionHealthChecksGapicClient.php | 707 ++ ...RegionInstanceGroupManagersGapicClient.php | 2112 ++++++ .../Gapic/RegionInstanceGroupsGapicClient.php | 550 ++ .../RegionInstanceTemplatesGapicClient.php | 547 ++ .../V1/Gapic/RegionInstancesGapicClient.php | 332 + .../RegionInstantSnapshotsGapicClient.php | 788 +++ ...RegionNetworkEndpointGroupsGapicClient.php | 804 +++ ...gionNetworkFirewallPoliciesGapicClient.php | 1459 ++++ ...RegionNotificationEndpointsGapicClient.php | 547 ++ .../V1/Gapic/RegionOperationsGapicClient.php | 410 ++ .../RegionSecurityPoliciesGapicClient.php | 1025 +++ .../RegionSslCertificatesGapicClient.php | 547 ++ .../V1/Gapic/RegionSslPoliciesGapicClient.php | 702 ++ .../RegionTargetHttpProxiesGapicClient.php | 628 ++ .../RegionTargetHttpsProxiesGapicClient.php | 789 +++ .../RegionTargetTcpProxiesGapicClient.php | 547 ++ .../src/V1/Gapic/RegionUrlMapsGapicClient.php | 760 +++ .../src/V1/Gapic/RegionZonesGapicClient.php | 276 + .../V1/src/V1/Gapic/RegionsGapicClient.php | 305 + .../src/V1/Gapic/ReservationsGapicClient.php | 964 +++ .../V1/Gapic/ResourcePoliciesGapicClient.php | 878 +++ .../V1/src/V1/Gapic/RoutersGapicClient.php | 1048 +++ .../V1/src/V1/Gapic/RoutesGapicClient.php | 529 ++ .../V1/Gapic/SecurityPoliciesGapicClient.php | 1146 ++++ .../Gapic/ServiceAttachmentsGapicClient.php | 872 +++ .../SnapshotSettingsServiceGapicClient.php | 348 + .../V1/src/V1/Gapic/SnapshotsGapicClient.php | 748 +++ .../V1/Gapic/SslCertificatesGapicClient.php | 615 ++ .../src/V1/Gapic/SslPoliciesGapicClient.php | 762 +++ .../V1/Gapic/StoragePoolTypesGapicClient.php | 422 ++ .../src/V1/Gapic/StoragePoolsGapicClient.php | 942 +++ .../src/V1/Gapic/SubnetworksGapicClient.php | 1126 ++++ .../V1/Gapic/TargetGrpcProxiesGapicClient.php | 605 ++ .../V1/Gapic/TargetHttpProxiesGapicClient.php | 768 +++ .../Gapic/TargetHttpsProxiesGapicClient.php | 1076 +++ .../V1/Gapic/TargetInstancesGapicClient.php | 713 ++ .../src/V1/Gapic/TargetPoolsGapicClient.php | 1191 ++++ .../V1/Gapic/TargetSslProxiesGapicClient.php | 914 +++ .../V1/Gapic/TargetTcpProxiesGapicClient.php | 769 +++ .../V1/Gapic/TargetVpnGatewaysGapicClient.php | 713 ++ .../V1/src/V1/Gapic/UrlMapsGapicClient.php | 893 +++ .../src/V1/Gapic/VpnGatewaysGapicClient.php | 815 +++ .../V1/src/V1/Gapic/VpnTunnelsGapicClient.php | 713 ++ .../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 + .../V1/src/V1/NetworkProfilesClient.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 | 4790 +++++++++++++ .../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 | 256 + .../addresses_rest_client_config.php | 239 + .../resources/autoscalers_client_config.json | 80 + .../autoscalers_descriptor_config.php | 244 + .../autoscalers_rest_client_config.php | 229 + .../backend_buckets_client_config.json | 105 + .../backend_buckets_descriptor_config.php | 352 + .../backend_buckets_rest_client_config.php | 292 + .../backend_services_client_config.json | 125 + .../backend_services_descriptor_config.php | 444 ++ .../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 | 644 ++ .../V1/resources/disks_rest_client_config.php | 469 ++ .../external_vpn_gateways_client_config.json | 75 + ...xternal_vpn_gateways_descriptor_config.php | 180 + ...ternal_vpn_gateways_rest_client_config.php | 189 + .../firewall_policies_client_config.json | 135 + .../firewall_policies_descriptor_config.php | 368 + .../firewall_policies_rest_client_config.php | 246 + .../V1/resources/firewalls_client_config.json | 75 + .../resources/firewalls_descriptor_config.php | 196 + .../firewalls_rest_client_config.php | 189 + .../forwarding_rules_client_config.json | 85 + .../forwarding_rules_descriptor_config.php | 297 + .../forwarding_rules_rest_client_config.php | 261 + .../global_addresses_client_config.json | 75 + .../global_addresses_descriptor_config.php | 196 + .../global_addresses_rest_client_config.php | 189 + ...global_forwarding_rules_client_config.json | 80 + ...bal_forwarding_rules_descriptor_config.php | 230 + ...al_forwarding_rules_rest_client_config.php | 206 + ...network_endpoint_groups_client_config.json | 80 + ...work_endpoint_groups_descriptor_config.php | 222 + ...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 | 162 + ..._delegated_prefixes_rest_client_config.php | 172 + .../health_checks_client_config.json | 80 + .../health_checks_descriptor_config.php | 216 + .../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 | 302 + .../resources/images_rest_client_config.php | 272 + ...manager_resize_requests_client_config.json | 70 + ...ager_resize_requests_descriptor_config.php | 225 + ...ger_resize_requests_rest_client_config.php | 230 + ...instance_group_managers_client_config.json | 165 + ...tance_group_managers_descriptor_config.php | 926 +++ ...ance_group_managers_rest_client_config.php | 612 ++ .../instance_groups_client_config.json | 90 + .../instance_groups_descriptor_config.php | 329 + .../instance_groups_rest_client_config.php | 283 + ...stance_settings_service_client_config.json | 55 + ...nce_settings_service_descriptor_config.php | 81 + ...ce_settings_service_rest_client_config.php | 142 + .../instance_templates_client_config.json | 85 + .../instance_templates_descriptor_config.php | 202 + .../instance_templates_rest_client_config.php | 216 + .../V1/resources/instances_client_config.json | 285 + .../resources/instances_descriptor_config.php | 1769 +++++ .../instances_rest_client_config.php | 1140 ++++ .../instant_snapshots_client_config.json | 90 + .../instant_snapshots_descriptor_config.php | 287 + .../instant_snapshots_rest_client_config.php | 282 + ...nterconnect_attachments_client_config.json | 80 + ...rconnect_attachments_descriptor_config.php | 256 + ...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 | 232 + .../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 | 182 + .../resources/licenses_rest_client_config.php | 205 + .../machine_images_client_config.json | 80 + .../machine_images_descriptor_config.php | 182 + .../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 | 287 + ...network_attachments_rest_client_config.php | 282 + ..._edge_security_services_client_config.json | 70 + ...ge_security_services_descriptor_config.php | 189 + ...e_security_services_rest_client_config.php | 201 + ...network_endpoint_groups_client_config.json | 90 + ...work_endpoint_groups_descriptor_config.php | 312 + ...ork_endpoint_groups_rest_client_config.php | 283 + ...twork_firewall_policies_client_config.json | 125 + ...rk_firewall_policies_descriptor_config.php | 456 ++ ...k_firewall_policies_rest_client_config.php | 353 + .../network_profiles_client_config.json | 45 + .../network_profiles_descriptor_config.php | 58 + .../network_profiles_rest_client_config.php | 55 + .../V1/resources/networks_client_config.json | 100 + .../resources/networks_descriptor_config.php | 342 + .../resources/networks_rest_client_config.php | 271 + .../resources/node_groups_client_config.json | 120 + .../node_groups_descriptor_config.php | 524 ++ .../node_groups_rest_client_config.php | 416 ++ .../node_templates_client_config.json | 85 + .../node_templates_descriptor_config.php | 246 + .../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 | 239 + .../packet_mirrorings_rest_client_config.php | 239 + .../V1/resources/projects_client_config.json | 115 + .../resources/projects_descriptor_config.php | 372 ++ .../resources/projects_rest_client_config.php | 263 + ...lic_advertised_prefixes_client_config.json | 80 + ..._advertised_prefixes_descriptor_config.php | 230 + ...advertised_prefixes_rest_client_config.php | 204 + ...blic_delegated_prefixes_client_config.json | 85 + ...c_delegated_prefixes_descriptor_config.php | 297 + ..._delegated_prefixes_rest_client_config.php | 259 + .../region_autoscalers_client_config.json | 75 + .../region_autoscalers_descriptor_config.php | 224 + .../region_autoscalers_rest_client_config.php | 218 + ...region_backend_services_client_config.json | 105 + ...ion_backend_services_descriptor_config.php | 399 ++ ...on_backend_services_rest_client_config.php | 353 + .../region_commitments_client_config.json | 70 + .../region_commitments_descriptor_config.php | 174 + .../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 | 624 ++ .../region_disks_rest_client_config.php | 458 ++ ...n_health_check_services_client_config.json | 70 + ...ealth_check_services_descriptor_config.php | 195 + ...alth_check_services_rest_client_config.php | 206 + .../region_health_checks_client_config.json | 75 + ...region_health_checks_descriptor_config.php | 236 + ...egion_health_checks_rest_client_config.php | 228 + ...instance_group_managers_client_config.json | 160 + ...tance_group_managers_descriptor_config.php | 906 +++ ...ance_group_managers_rest_client_config.php | 601 ++ .../region_instance_groups_client_config.json | 65 + ...gion_instance_groups_descriptor_config.php | 151 + ...ion_instance_groups_rest_client_config.php | 190 + ...gion_instance_templates_client_config.json | 65 + ...n_instance_templates_descriptor_config.php | 154 + ..._instance_templates_rest_client_config.php | 184 + .../region_instances_client_config.json | 37 + .../region_instances_descriptor_config.php | 63 + .../region_instances_rest_client_config.php | 126 + ...egion_instant_snapshots_client_config.json | 85 + ...on_instant_snapshots_descriptor_config.php | 267 + ...n_instant_snapshots_rest_client_config.php | 271 + ...network_endpoint_groups_client_config.json | 80 + ...work_endpoint_groups_descriptor_config.php | 268 + ...ork_endpoint_groups_rest_client_config.php | 249 + ...twork_firewall_policies_client_config.json | 130 + ...rk_firewall_policies_descriptor_config.php | 579 ++ ...k_firewall_policies_rest_client_config.php | 461 ++ ..._notification_endpoints_client_config.json | 65 + ...tification_endpoints_descriptor_config.php | 154 + ...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 | 95 + ...on_security_policies_descriptor_config.php | 383 ++ ...n_security_policies_rest_client_config.php | 314 + ...region_ssl_certificates_client_config.json | 65 + ...ion_ssl_certificates_descriptor_config.php | 154 + ...on_ssl_certificates_rest_client_config.php | 184 + .../region_ssl_policies_client_config.json | 75 + .../region_ssl_policies_descriptor_config.php | 213 + ...region_ssl_policies_rest_client_config.php | 222 + ...ion_target_http_proxies_client_config.json | 70 + ..._target_http_proxies_descriptor_config.php | 195 + ...target_http_proxies_rest_client_config.php | 206 + ...on_target_https_proxies_client_config.json | 80 + ...target_https_proxies_descriptor_config.php | 277 + ...arget_https_proxies_rest_client_config.php | 250 + ...gion_target_tcp_proxies_client_config.json | 65 + ...n_target_tcp_proxies_descriptor_config.php | 154 + ..._target_tcp_proxies_rest_client_config.php | 184 + .../region_url_maps_client_config.json | 80 + .../region_url_maps_descriptor_config.php | 260 + .../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 | 328 + .../reservations_rest_client_config.php | 304 + .../resource_policies_client_config.json | 90 + .../resource_policies_descriptor_config.php | 287 + .../resource_policies_rest_client_config.php | 282 + .../V1/resources/routers_client_config.json | 100 + .../resources/routers_descriptor_config.php | 360 + .../resources/routers_rest_client_config.php | 324 + .../V1/resources/routes_client_config.json | 65 + .../V1/resources/routes_descriptor_config.php | 128 + .../resources/routes_rest_client_config.php | 155 + .../security_policies_client_config.json | 105 + .../security_policies_descriptor_config.php | 348 + .../security_policies_rest_client_config.php | 277 + .../service_attachments_client_config.json | 90 + .../service_attachments_descriptor_config.php | 287 + ...service_attachments_rest_client_config.php | 282 + ...apshot_settings_service_client_config.json | 55 + ...hot_settings_service_descriptor_config.php | 68 + ...ot_settings_service_rest_client_config.php | 123 + .../V1/resources/snapshots_client_config.json | 85 + .../resources/snapshots_descriptor_config.php | 216 + .../snapshots_rest_client_config.php | 222 + .../ssl_certificates_client_config.json | 70 + .../ssl_certificates_descriptor_config.php | 148 + .../ssl_certificates_rest_client_config.php | 166 + .../resources/ssl_policies_client_config.json | 80 + .../ssl_policies_descriptor_config.php | 194 + .../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 | 303 + .../storage_pools_rest_client_config.php | 303 + .../resources/subnetworks_client_config.json | 105 + .../subnetworks_descriptor_config.php | 389 ++ .../subnetworks_rest_client_config.php | 337 + .../target_grpc_proxies_client_config.json | 70 + .../target_grpc_proxies_descriptor_config.php | 162 + ...target_grpc_proxies_rest_client_config.php | 172 + .../target_http_proxies_client_config.json | 80 + .../target_http_proxies_descriptor_config.php | 216 + ...target_http_proxies_rest_client_config.php | 200 + .../target_https_proxies_client_config.json | 100 + ...target_https_proxies_descriptor_config.php | 352 + ...arget_https_proxies_rest_client_config.php | 268 + .../target_instances_client_config.json | 75 + .../target_instances_descriptor_config.php | 215 + .../target_instances_rest_client_config.php | 217 + .../resources/target_pools_client_config.json | 105 + .../target_pools_descriptor_config.php | 444 ++ .../target_pools_rest_client_config.php | 349 + .../target_ssl_proxies_client_config.json | 90 + .../target_ssl_proxies_descriptor_config.php | 298 + .../target_ssl_proxies_rest_client_config.php | 240 + .../target_tcp_proxies_client_config.json | 80 + .../target_tcp_proxies_descriptor_config.php | 216 + .../target_tcp_proxies_rest_client_config.php | 200 + .../target_vpn_gateways_client_config.json | 75 + .../target_vpn_gateways_descriptor_config.php | 215 + ...target_vpn_gateways_rest_client_config.php | 217 + .../V1/resources/url_maps_client_config.json | 90 + .../resources/url_maps_descriptor_config.php | 268 + .../resources/url_maps_rest_client_config.php | 234 + .../resources/vpn_gateways_client_config.json | 85 + .../vpn_gateways_descriptor_config.php | 263 + .../vpn_gateways_rest_client_config.php | 260 + .../resources/vpn_tunnels_client_config.json | 75 + .../vpn_tunnels_descriptor_config.php | 215 + .../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 | 1618 +++++ .../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 | 1809 +++++ .../Unit/V1/Client/DiskTypesClientTest.php | 368 + .../tests/Unit/V1/Client/DisksClientTest.php | 2291 +++++++ .../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 | 3091 +++++++++ .../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 | 376 ++ .../Client/NetworkAttachmentsClientTest.php | 1017 +++ .../NetworkEdgeSecurityServicesClientTest.php | 680 ++ .../NetworkEndpointGroupsClientTest.php | 1087 +++ .../NetworkFirewallPoliciesClientTest.php | 1825 +++++ .../V1/Client/NetworkProfilesClientTest.php | 267 + .../Unit/V1/Client/NetworksClientTest.php | 1344 ++++ .../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 | 1423 ++++ .../V1/Client/RegionCommitmentsClientTest.php | 648 ++ .../V1/Client/RegionDiskTypesClientTest.php | 297 + .../Unit/V1/Client/RegionDisksClientTest.php | 2209 ++++++ .../RegionHealthCheckServicesClientTest.php | 702 ++ .../Client/RegionHealthChecksClientTest.php | 842 +++ .../RegionInstanceGroupManagersClientTest.php | 3009 +++++++++ .../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 | 1323 ++++ .../RegionSslCertificatesClientTest.php | 572 ++ .../V1/Client/RegionSslPoliciesClientTest.php | 774 +++ .../RegionTargetHttpProxiesClientTest.php | 707 ++ .../RegionTargetHttpsProxiesClientTest.php | 988 +++ .../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 | 563 ++ .../V1/Client/SecurityPoliciesClientTest.php | 1399 ++++ .../Client/ServiceAttachmentsClientTest.php | 1023 +++ .../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 | 1383 ++++ .../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 | 2045 ++++++ .../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 | 2777 ++++++++ .../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 | 311 + .../Unit/V1/NetworkAttachmentsClientTest.php | 892 +++ .../NetworkEdgeSecurityServicesClientTest.php | 591 ++ .../V1/NetworkEndpointGroupsClientTest.php | 960 +++ .../V1/NetworkFirewallPoliciesClientTest.php | 1636 +++++ .../Unit/V1/NetworkProfilesClientTest.php | 208 + .../V1/tests/Unit/V1/NetworksClientTest.php | 1194 ++++ .../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 | 1239 ++++ .../Unit/V1/RegionCommitmentsClientTest.php | 563 ++ .../Unit/V1/RegionDiskTypesClientTest.php | 226 + .../tests/Unit/V1/RegionDisksClientTest.php | 1968 ++++++ .../RegionHealthCheckServicesClientTest.php | 589 ++ .../Unit/V1/RegionHealthChecksClientTest.php | 718 ++ .../RegionInstanceGroupManagersClientTest.php | 2700 ++++++++ .../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 | 1155 ++++ .../V1/RegionSslCertificatesClientTest.php | 470 ++ .../Unit/V1/RegionSslPoliciesClientTest.php | 654 ++ .../V1/RegionTargetHttpProxiesClientTest.php | 594 ++ .../V1/RegionTargetHttpsProxiesClientTest.php | 853 +++ .../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 | 474 ++ .../Unit/V1/SecurityPoliciesClientTest.php | 1246 ++++ .../Unit/V1/ServiceAttachmentsClientTest.php | 898 +++ .../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 | 1254 ++++ .../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 + 3793 files changed, 833802 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/AdvancedMachineFeatures/PerformanceMonitoringUnit.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/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/BackendBucketUsedBy.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/IpAddressSelectionPolicy.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/BackendServiceHttpCookie.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/CommitmentResourceStatus.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/ConfidentialInstanceConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig/ConfidentialInstanceType.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/CustomErrorResponsePolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomErrorResponsePolicyCustomErrorResponseRule.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/AccessMode.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/GetNetworkProfileRequest.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/Ipv6HealthState.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/HealthStatusForNetworkEndpoint/Ipv6HealthState.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/InstanceGroupManagerInstanceFlexibilityPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection.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/InstanceGroupManagerStandbyPolicy.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStandbyPolicy/Mode.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/InstanceGroupManagersResumeInstancesRequest.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/InstanceGroupManagersStartInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersStopInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSuspendInstancesRequest.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/ListNetworkProfilesRequest.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/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/MachineType/Architecture.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/ManagedInstancePropertiesFromFlexibilityPolicy.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/NetworkProfile.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation/Scope.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AddressPurposes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAliasIpRanges.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAutoModeSubnet.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowClassDFirewalls.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudNat.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudRouter.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowExternalIpAccess.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowInterconnect.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowLoadBalancing.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowMultiNicInSameNetwork.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPacketMirroring.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPrivateGoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPsc.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSameNetworkUnicast.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowStaticRoutes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSubInterfaces.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpcPeering.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpn.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/InterfaceTypes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetPurposes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetStackTypes.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/Unicast.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfilesListResponse.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/BgpBestPathSelectionMode.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/BgpInterRegionCost.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/RegionInstanceGroupManagersResumeInstancesRequest.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/RegionInstanceGroupManagersStartInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersStopInstancesRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSuspendInstancesRequest.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/ResourceStatusScheduling.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/ResumeInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstancesRegionInstanceGroupManagerRequest.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/NextHopOrigin.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/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/SchedulingOnInstanceStopAction.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/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig/Type.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/SetLabelsRegionSecurityPolicyRequest.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/StartInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstancesRegionInstanceGroupManagerRequest.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/StopInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstancesRegionInstanceGroupManagerRequest.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/SuspendInstancesInstanceGroupManagerRequest.php create mode 100644 owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstancesRegionInstanceGroupManagerRequest.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/TargetHttpsProxy/TlsEarlyData.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/resume_instances.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/start_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/stop_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/suspend_instances.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/NetworkProfilesClient/get.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/NetworkProfilesClient/list.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/resume_instances.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/start_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php create mode 100644 owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.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/RegionSecurityPoliciesClient/set_labels.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/NetworkProfilesClient.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/AdvancedMachineFeatures/PerformanceMonitoringUnit.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/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/IpAddressSelectionPolicy.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/ConfidentialInstanceConfig/ConfidentialInstanceType.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/AccessMode.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/Ipv6HealthState.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/HealthStatusForNetworkEndpoint/Ipv6HealthState.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/InstanceGroupManagerStandbyPolicy/Mode.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/MachineImage/Status.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/MachineType/Architecture.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/NetworkProfileLocation/Scope.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AddressPurposes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowAliasIpRanges.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowAutoModeSubnet.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowClassDFirewalls.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowCloudNat.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowCloudRouter.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowExternalIpAccess.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowInterconnect.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowLoadBalancing.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowMultiNicInSameNetwork.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowPacketMirroring.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowPrivateGoogleAccess.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowPsc.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowSameNetworkUnicast.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowStaticRoutes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowSubInterfaces.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowVpcPeering.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/AllowVpn.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/InterfaceTypes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/SubnetPurposes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/SubnetStackTypes.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkProfileNetworkFeatures/Unicast.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkRoutingConfig/BgpBestPathSelectionMode.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/Enums/NetworkRoutingConfig/BgpInterRegionCost.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/NextHopOrigin.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/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/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig/Type.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/TargetHttpsProxy/TlsEarlyData.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/NetworkProfilesGapicClient.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/NetworkProfilesClient.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/network_profiles_client_config.json create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_descriptor_config.php create mode 100644 owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_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/NetworkProfilesClientTest.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/NetworkProfilesClientTest.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..1f8115a5ff5d92e47a03432abab2e794086f9ece GIT binary patch literal 685486 zcmeEvd7P8gx&O@!+niwuVS7bUj7za9)=_D-wQXi5FsZY37Sz^z-y3EEqz=h6$*6d5 ze-}kTMNx4<-b*k|~dNGy^Fry|Y6$4wrdniv`0nuw?3P4SlDhL5Q&t%{_=&EZt|gfaZ_31#&031#x*6UH9;TOpcS!pY=t^^^D? zF&zJEZ5!7TZ5p0Tg;V&?zR{!}jYU(@a7*-5tl;S3D_%><5=<0!wqn12?;>J387djl8A*{PAHEgn-bC1R6J3OSC2YsLL_CP zj(!<&fSQ(ui;f>YLc(~|Q5irUJv^0Yi`Zu$K0FagwIyP|Ww>d8f0+L|Aq%nstPCgH<0ou1W!pt zV$G4}npQfV9b2Zkdx6;G?9lRlAN>2M+TB2Nv$>h0ao9(g=%>y2g;>7s0I^?Q$J{qW zzBZC?!$@@-MxJ!&Q1#%DaBCD-h4w&RjG=p}f$70`LbN_kVOqVgo9%^!LZ^DPzXPa< z!kHd7k(M?DUqzhjL&CAi@{#{_kLVjXwtnp4_0b8jFpgowx4RJGrlv?Tsh=2`tex@h zGjDr_dqxyh{Kr`yk8e-W$9kwoo3*>wzcxcY_t0~{@Y$Z96iFnpdD^^puGyc*D4=(S zi9Yc}bV4+yCn6K*@h#hz|37|Qh{vUUM6qs-QR)?aZGU3Q(m`T?{TDR}zvvj(zotMO z7#J6hHOFJ27;Yr)ebV^Hm_)p-wJID7PlzPyB7bj-BvZcq#o(xVPoF@~^-1yt?UAit zor5 z^tC9sB~W{dp4i{NMVeCD<(IB#VQBjR+Aqc!zx##?VE}`jTY1`R{Tb`LvAc_Ir^aIu z?dB)e^LCaB{+55_EwR4ze^MY0&4h)vG8@e;JGd8xe_T=lc> zN{2F zzvEZ>(7&uu^s|A{fZyo4HzguWq4iW096lAE)T-Tm{u6zzlQl+&=16NI(nNBGws_^L z%@U`-bj4}8dL0L<9$c<1S;4er4^iB#_%Kn8?bBa=ibg7`V5;I31vu1mhvJuR6+}pU z14XwJqp@b~;;m20_qx%qzZ63!g-?l2YMZ1tg%iz59n{i1B-)GLy#Ei3(7mF&8iC{% zZN}zjw?tznYUj;*>^1qUr~1NijVgNKSEg8*c;bDwP*d7h^ww<) zEbT4|iQM%R-E~?==`gW72$CD<{2oDD+FJsw}kekG79=< zL!lz~^`d(;6`7ROmOsDskl}?OSpnBw%Q^PQ5DgQIr4o}f_l0+NFVQas7N)m?BI~L6 ziIJFg$yw&8+y-s&NucUuexv1wv>TuUUWU3t~C6u>R=9VvRA98Scdu?gB0Z(pim zYl};UyDs5a`Dz6nl%ZiEY(N)_LSl!!)xJ{E{iJY9TSP110S|K>FbyZk`X(@EM)pw! zzwu=3uupjPG$f?$rVzb!wIKg(1!6$j1TNcnRK_-r$QR@vW4CsGQ+^=EZuW?wX&AF@ ziEoUPq!QIjY6~B^?Q0Jo{rqvZa|oaIK(|G*qq{r&= z_k`%GNA*^1`^Fi+!5~F^gCS`4jzv-@#}g-lIYkoMOH1F_A|YbxPB@Y(rQVuK=*{s- zVaTLB!S^qJd#QYrDL!aZGSbwRh^8j%t#Rm}leG({J^g2%iOK$6qHi(++QkYgjiz0) z{DW;YLNDe3bc-1IOXt5X$1TEU`_K1?;%W(D0{{eP8QfT19vmI24wmcH!G>dN>W24d_!(bs~c;rQAhAn=Le@=#r{ ztU(XejveKlcgMK}zCogIO?6OjsL|;^)qw`@n@i6f!Lqnxw@ddFd+3f|ocnKaIbwIr z#^@%feJ$-L`hYN6TgfNW!nS?yN{NW3?N(`j(GS1bH;5k$9VSWrTi-a#rmcQWpE%(xf7MJXolcE|UOIckLy`oA#&@Q?0^uO1i|WYsy3 zZ?XYBQS6)ch7JRdF{*{orT4z`Ka9^3SA04_u)!wLbCB305ov7!;&9*~)`0ihr_#Q@ zeRC6EOeRY%aySdedx>EH%zdbIK^^+$FP+#@m)i+(S43JKO4q**uiFd6ubg<5TGzi5 zcH32H|8?lUu|Vtv^jAc}EvboR6C+J0HiQ$ffRf?UILmpQpLSR1aut<%qBzBqg1p3A zv~$*fJIYgiYQH2#0YNau68>Beu#%*DL5^yXLPVvcfMi~&B|25HlcACmS3`SLjH zxsP)GmbRG%LIWJtao7du{}?g@NifvL@S8MjX{T?WvChVC|0edg9!l)c-&rto@5?KH z-www$rzWJ(AOA9hZ1ONdY9o;Z__|^M21162o=SMqZoTWwxJ4lTCiYVgBqmzr=b5Ku z$$5+Klc&U8{7{n;Dij!UXY)G9c(m$hxyY?3)EyQj%)_Jmo?3+GX%CWFH25BaF9t zhtB5A?^jHhDF3}H%B^*@i}W1CIsN)Q;bC@O*VYo*SsDH>VpzK3lfZE1QPZZrz4TTsazEyRV6lOP8>Rtxnqh3wuDp5nJlc6> z)!GA(VWKe~|MRrF{*Rxs1v!r+>VhybF0qZlKDqqCHeLGR*jgYCpc@60c8Wgob4F~t zcfV6HKU)!g6Z7@TI_I=XcCEE7(Hc)i zwE5qBraUQq=*i%W$c>7=^t+35x1ah3aRmqi(7w3xp0SJ-Fa3`FNVbhLG`>%-UoX#i zMSpte72Vr#{FB;QSIjwrT){&R7R7dqI2^it><--`^3D1qqF5o49U>0bOrX5HE?8f$ zE5}Gb(JOddL$IzoQ0ZNH{SGg=U_#aEhh>{CJ(Do)ZLF@Z4VHyQhv38E58wUtjotiz z6-A-eu`*5ycpGSWT|%`wd^Po~VBE;EYQ;w(BL^aW;igF3r} zyp&|@mwVWc+OL1BP?t+Q2o92xlO6ZIUyGu!@w0Z#*3+(*(nR~n>78m z^?Dm3NsRaa2vORCJ07}{WV2o}m;|9G2=W^rPavEZUg1e`Bmuy_0Kae>{-vG!@O>&! zg~h_Xg*P=3v1BSVuqmF1Xs^6};SDrk_X?H`A$b7ead8aQ9MKlcT>6}p1UbMElHf_v zWR#Xc->S&WwO^fo!U;SAiHrU_JYu(63#KX)q((r5fQ|huN?#kS8(mXZMa)94s;Le& z)DU;j8}Tn@aD4)GWfh?YFssHo2q16X@ok8>K(M-kJ}LKZnRX{w-XY?IU*s4G!_a%I zZ7r#!HuuRH6l~f@hM&U798WYOlyux=ZNrWyD)FR99u_E#wwT7JZhy3hpYd6N0G<)F z%^~J=xMf-h0wNQXNoov~n!K(#Hgv{)4B#;SNTtcCDiXNQmM~oEN%qL&wu?7) zDc*ENA)><__lX_eyZBPqC3vIb31mYwLzE{k+%AIGWe8rTOg^S1J}%s1CG_sPR$b*< zU0W#jcGA5HE7Wt>o$4}o>gGa(mpk~A5og3_U&$Ro7?b@j>vr{(| ziv6?iR6}GE5#t{c^5Zd9fKC^sop9}Bl8C&p8|_NvS5)vbl%pmgd7 zBRO&%V<;yQNTuMXnS_!xySA*$Y+0tvuAFJRY)W0qrgUQ={BF*>rNXawU8^qWp1QLT znWhejUF}w|c|ybpsNH2=?`mGfOwHKXHWm3MGx~O!oVtq1>FPqH6g%%3A}Mz5QrB|U zFDOKQUB)i$(ujWsQ5BS=yGs=8Qlem{MqEqz8>y;jBEivUyVR>Lqh4id#I;=7sT}nd zxn5o^7q8l773?}z!AujbOv*$F=}FPlF7ri~qJ^2}i@FF!49Z&1yX5q)BBy8aEbJ2( zem5#n?AoiYvRCs9QLDfqt=Gj-i+@+dX4m0Snb*m%DebyWUCpMH#d50*f4eNVUC?ry z84O*YY$=N%bz*#!Dv$3{uDXnJm6=|Et=dHZyBYz^!mN-rhwAK9_i>kPsf+7V_10eP zB7I$%^qCbbc5PFa*``cek}Tv}kxI4JCgP`{g5oZ{x2x#ASp;=!x01WItBYj-XA0_a zw|2#Fb~(3Vrl2mjiUh!21hC6+t4u*%Zc{_kE@su$lqxsLVr*+{46GC$`-%t|I(pvZ!4*sS8?XGvocRO$}|xFW4nWbRGB9Y1D77B^pkKTI<57 zMM|A|QQNO6+MLi6^n>>Fv+HF&Q?8n{zZhgy)01z=_Gu5^c^bD-DB}8CT&CDDPN^ma zqn?pbyVLfme@S-~2x@7G!)A|Cex^Uu79QY>3NNa1qq?VAVK=G0v~}tuvXa>`?sZXf z4l8Gfn9U7BvGH-=--Iv0fe9!^hJUcP147QCq+@``IGyf z`z@D=Vnn0fDs{1IiHDnIUD?yWyZv-ozKW{d`ll3#USlVX=1)=N3I#!pGLd7e^wEK; zQ04I`6}F$))BIB}tE_269n#uHy*wz(S2i5x-G1IZ1APaIeY3q*i4tShyGK-d-#dN9 zVJIs$!u93a8Z@h`uw&18*Dlr|(95JvD+cFEnt=cT-hLjiVNKYov)>e|qx7Hmd2S2#WUE z_fP&OE>>~L=sXbY9JXE!S$|BUHM2x0HPLjL(f_~VVC(ffM#Kf&U9QG#ORS@LE@vTA z$MtVMJN*cgG;m$L9B=zkBX_hlebyzY#}TvL5o~5C)rXdu5OgUjE7DAbaHuFWwe8T8 z(NocMXqoDaFQbD=EAjS|jQ%fkC!U-OxbK>Z$7j$?>Lp>~E&0>#C4M+eHNSTBkk zSC6dLeJx{{h+-8hcJ$~j+&Y&ZPjVB zu9q9Y9E3V&$ZDICf!ulf)7&Cn7RW@OaO$hk)Y_)gF{4VE+Sa)rQ>OvhU7HD>V*=GK zg9~`_kX*qreH8z9)a}c>eYPda{a_|f<;2ko5+y*JRk6%xzdmQ0G+Q$8gG6`Pv*0l21HepO)8A2PP8^}{;T7e0Mza5p12<+S@7`y zp}E~iZTTZB=F4rN`j3oO$I?rCi5?OOj9~lvN(YO97DcdDRJyy^O?R6RCBS8`08c(3G<*d)Ql~BcWhQR)X|0)m4B*bE9HQyAG z0nsSsN|YiQX;u-@hH9KgH-!;GQ!QM><|wMbvo?S0Q@^6q*Wo@l4|z}w)B$38%ytJL zL~YF>3dCk3^4oxL!`eH-7KH8g5y{ayBE8eY4FwP-T3cHtH?~sak7PsKAX-V|ANGPT z#(MS_gU$0kArWtDMYH%A-1Q0Vk*!~zWPy6NM~uq;BASKKw0fJI7ZPt;+r*c)JSUs8 zx_5!k24T{^8U?Q0*gQ^2u7+U#hYG}R?1S4-C8NKyfzwfhE7gSJKPtZbJIF-pw|i*&J>*_GD@OWI04x>h59Lw zYqghNyyF5X_9t^k0^_JY-W;Jm zPtwG;ddVC*rmDtxgBZZ%ITCA1Ol~F18Fir2&fN6qX*6(g$w=43T-KIM#V17)LGx2I z(2@<0+!a1zHA&SK0F7O` zM`O*AQ?wUXeR2ra(!GMaCLJgGM^P#th0#eHMUC|Eq$HTqy}fw3N4Sn|-=>f`KrMe? z!OfOj^jL0~l+nS7yCn@2y;`s_u_S87zj)RZZmCd2-6Xg@z_nj;7v-V~Zk>dtQ^_zi zYHmpq(O$dp>PO|l;KoTOoFMi}PK-ucn(>Ayq^X6fPo_S)_OHCi16>!X7Dm>Ph*V4~ zjP6TPQPAeTutN5i;_gcTH3g%Ywsb!CDJ!a=zDxeU;ZWNSF&g9ywoGcarURt94~I3z zYC{lov=dmgdfo#bAG!(!>Z(Q^?)_%vN5f!q>v7y~M(OzTi3J}#?eYIW1A+e!qFWVG zp3!%wuLWaOO*z5lr3N@K{?$~&47%j-;(z_RzjC&V0Lx zLDn$!0W{Omso@Tdwy)TuJXC*-Zu`}-+UFm7dMPzeD5^F4@O=I9Ws?a)HcUDoR1Kui zEeO3C>O=Jn!RiL@?9FT5pq4{D>&xocO8NSZ&p(ki5Ia%fYW+4c!d-NTaPR{gtzgA5 z3wdDChksWVolIGXv{Al&rPR15oqaxwQkVc&Zf!>S&FRHluzPb#Z8lPijS0miEBL*GR!tO&l7tGyCKago#+1cFBWheM`tKl;l(seG-vY(8sWTDn?6cQ|>)?2$>gre;0!c zb;3|p^;CF5QrkXv#$D3%R_#jSa^e6M8a4;3lBf+BG#E=ICj0gf{mm&`;{XaaPVJp5 zo)HWX7@A>6nFPgIyJy2Rjgi8%AGF!D%hF@W><(tT=)%oQc8=LH6QM?<478q974ozV zb7uaI=V#8Li#^j`NQdC{nIE#0(Q$Uq%m?fqq5wtsqfa>OL+c*@=OTGahjA z{>S8JgxF-8P73%(`_-n~&n;c-KU(*lVX$8t zhf5;MMJe?OuVJq=j(X|dVz2by(oVOW$96vbmwC_xtgShkQnvTeqJNnF)LY^cKxaX8 zK}%+R`~{4hg%E*rh@3o1Wqg7fXm{a_oC1#vwV;|5p;kIc?XovF$CyZJNzH z9gx4wSo+w79_n7mKS}xM<1^=?1>){vpfQd^-g)-vS3;%a|8fDJn+O>Y`{(rp0A@28 zU$yX&1VgQ5P{SW&2PAp2_S(9SqgZfpNe<78^%ZB1O_n~WcG|u&w|8y(%3cFU+gIlC z88Sb!cl_#XsLCo47-u2^7LRfhB*BwhrM4lZ)Evmv3ozMFMG?)ds&?R46N&O$6;Y|uOHgR?K?25IHN${a-_ANt zu&%DA&bwjp%DpJApccJV>G9T^KKF9dt<2NTKR2P@9Bb{V=p<;r;YqDZh&N@{((a-V z-e0GT%{?;*i2g7DIS*Z4-7u*!rrZo3mGJL>s1S;rd6vxZn`W0Ti`5xj7Jrw=k#G+C zGi;0rQBZ{7lUGvZ&K*Px&7IpDb0M=HqhFWH#vPHdar@-4asO5wGFSFMCrb0EJINH7 zJnmtVlz{0|ZhpdI@`M3qy{4&z1F$~soDqpScaAbYHMMOKr7;^z;SwYV->h| zEkdjU_1@QB+6xUd_bqFzZ>Xu#tAY)6p)#GhI5&4jv+9}}y}mY3hfcwZ@A~u#50s%n z&bLF=V*{0;a_`IcEepf$)|cdj;GY`q%;Ler%h{`__$D z9!$|&#+w{_B^w^IxJ%-Ogv$Hk4d;K!{gugBqt}cc?OlA~f@VfPf_ei4ZCHAOdKyN(Z?3$z0%1x+8L8DZjbkeG zKR4C@kighLs4`Gm8T3AM+uY?IGG)~T$3W5tZk6;7l$ISs^MCi$Ss?S6i$J2KGz99# z1RM0U?V5YhvZH*X#3A)%6~XexO6-`m`D0jbsFQ$FLup=J9b@?6jo5<)|!QftK!jY)A{0JD94YY2@|^DlC*7`N_%hBX0}onmz3tepi0D} zmKwv^=8_Hz3MxXoRP-W+c)|vtr1t#9YlksnS+Yi_T?!a-ym9r{SAS3Bw!3sefZRHb z=qzUcRd`8Qj=&;Gie4%KYsIS%JjZ6I;*t(*2?>LdPz-t>jUgp;UG%5H2}6b?p486x z>VX@j%=^du@slo!OL1XnLJUe1LbJ&c6;6RRN4N3x6OcAI%eG^4*vE@RA<^CE-|gn> zDGF+;y>Aa7>QCl!8|i)g%MBGoW%y@M-I*_Jf6r4oL=3_XWL_aw^3!fj=`gW7baTWo zXFY>5fGq9Am{Dc+L&8*tjs-uZ&9a{a{}vC53#TK+dHE<_6|Ll(qcHfKgpSaW)WmqR zwqo|#-0xQfL_wLfT@fWJYtMbMjpD~Ve18#k>_y;{8V8pS!}#_RyIZ<9ya44P)*6T> zSJaflg+OtRps(J0pPR*8xTdxtR2BLQEKHIWg%E3fym!Y3k9B9Wdj_DaGGu~A!uyEK zg}cxL*EYL&AZd|y`^MR-F*YmC2a2Id+zLiEbQEf(jo3A){Zw30TmH5XLP*iY9)MU>+k^UGSxt4hcgMDuCzHEsOrUX0(EHjQ^M>2oy^_`> z@x$lY9V0Hg#I_QbW&6jA12Q(yjmqK-=RBWmlNuxj*y+4F#Quk~T@j)i7BTeIh`~g^ z`FfEv(xT!U*IY6dJDt;{HadDrq`4+hi#8%S9nv}j6F2F%`pIx9#ZP8Vd)Jg(`!ltt z6UJ7?>~k_bN&DEpl!8msFFLIPr_?ZiK+1*R+*G4&t{>*@u%^M9No7*Ui5=!l1I92)QrByD0J^N`b2;i@SB+!doQ+Qy!vT1{cw0FPyX3 zI@EA77V(PM@bT8vrw9>66~y2&lz(c(ZNMpwzBb4>nO12-iT|IKn z_r^_M9gPtRD%fb2{+c<_8<*Wl5efy;>ZMj`qXya&TUU?f7ue^67!*+d@sR|4O@L+F z7h~|OsDj)z{;=p{3SaE|-a}{>Ewm(j(ysSB<%;(JEA+nQy8ZJ`u{IUyQ zTYKT-6mzfq;q4gMndI#whA5o|1GU0~5z!|`!p-DGxpc+*h-o6{uPa$5eou;71RYn1 zMYJV|=&1Fb|JsuS7#OAjy9;4>x0++xKkwemNdvv481FFT^RhV88I*|JUtOUvo| zo3Htq1pRDV!gE-=;BKZS&tx*vGF}IFKGFYlPcbt|qCJ!!+Rbxb$|IN2z%?-y_lRz{IGjEmho2`zD29FCJJIMCtwb{{Ke7LPeKKyjY z2Qm(hFB@4ZK~d*zRGl+4rwn%}E%*loA2HeJGJuW)n2UA!a7Y0->!w<1AJ%)Ro;Enm47J=_kVl z%I>cgFukptS{WC7hYuEekj8=A*Oovq4euANpMn-hNPGN-`=-zWRq)AhG0^rpZ7kjO zq_$+!^>;8G@}KV!MFeVuFQJ3Ql?7nFGp?T|yz*}{7vAWB3ej(L4g2`{ zeLVNx{^q(5J+NW=ltopy4fW(b8B5@0@wfAjb}j#+q8%n!#~Us?B6O)4o9+7~(p6 zi@`XA2?((;w!y%IgO-Z4M3X7)_E%5ajb8Cj6bELXEBnC)`)IG(t; z-N;X-_T;0>$_)j@(W|9BL^ryx{zV0%zhf#FU(Ihad^P*$M~(ii+%>-!102YboRpL( zQ$p2Ne)kCp&*~Hr$1$JzH$cfz1Juj-4fryKgvXDksK&`;#5yq=p?zUGGUubaZTTufGpW{{2y?gjNKYkzQ@Vyqx_fQiYDxzxF8PD&z-jm~$7)bRDSoT0#QiW?61SW9 z>cntzqBeKouX%#sx=v7Leo=uBEZa*YQ6EXA0Bll%~QV zm>~TyS(ydcc4cK2XkpDTq%^%*k7@Tm@x;kMMK7s{jurh3Ey~!8E5EqCgmL8_OYhu_ z(MrKrTfq7&s66f$au8cVZd2O&RbR$2rc_{Yb^8DxEvbn**l*K`N$u9#K3F5^^zTJs zG~BAadUFp3!95Ph2|_4PD+Apf!hc`VC=iZ|5+vc~W>RiQ5S3;HW3^A-K4m|Kj3VDN z>86){g~=z)dQGO4NfGVQb00=P46Um_y%!Y&IR~7`O3OGo1I3xn`{If+7O5&+PoHx+ zm2t9Vr6yaa5V(}+#W6*A8<_wzrkboh^!1wGGdMm1r;1Y2jet09-l`Rx7hYVFFA+jW znVhX+01Y=<3?P9E3^Wp+q#G78?Xranhw)zR?Yg*fWwWXnNaIwBBA8Lb$Z!oOwFNIv z@5ZPZ<@&V~H6vkbm){0Cus1`C8$@#q5j|CEk#_4{XUd~DSmLBVdSgJ~PEb^nJPO)_ z&zuV%57D0kT%o9uUm=`HepE4phQsWXI<1{{$BU9_X!I*s6a6X$oU^BYC^gsJ=n?E; zh^CZj*q6<_X$0@qPDw?G&P4&jNB`O(* zf3kMrOitV{s@RLZhh~CQ88$H({8zhU#pRp>Ra7yYUI`=E87?{U!KJ;aIJI`p4Nw1_ zH|tQ>&2kRz!AJuJ;;B{(=wSfy|?^jC<%aGrBVs8Jugi?E3Od_Rt1!G9~Nt%OM2tKj7x<6+EsXSXUjW^sc;qhZpzNYy5ynis}G`a?iMX)>j+^$R$kZ)n%J5J(Gxz z*Z9SJcgHIq_NRCo^8s)(+I;%l>{YGsWDPU4#q3~hzv#ND9{<}O;WhcfIJE=A#UA!W zQEW=X@p@&ch4|e>e{*#6=fxjhGKYv)pUPmMz5(GLe{KxcH+Z)_dc|O0AJL;KFs3p% z*8B17kAFkazfxBXRH6tJMXk$#ktsVC*3i3kf$H*_D(@qA%>D;ick3v$q#{sX;a&E| zZ3sqzak;JrAnJ8Br3hKsHtmiOC|$o}gP}1MGCGB)nzinU$$n(-_NrCH5ii-|m}~25 z5QtM#i5-IJdQ4qynRotK)3{VjMMFca_pH;-;uuW&qr`jD)n5-MHy-^}?_EiM!P8w| zU+Mj1YIpi)Ls_kN#dQ8>V|lIj>hrs2E&b%5Q6T!&ODYsl>Vh*xpk7((0;5NVs>yZx zAB2Ol$`G=-a3;NT*M78sD7a?+gwQSr8ZVynYzg7mdV#`rbY8Ic)-TpZ30t;@gb43~ z$Ik9eCv!}&I!Jc>a=omk=9o~>d)ISM-_BuD(ypM74h1XAy*He_R;L9LK8!cNy>=?h z@eY49Z1?pIbu|><#iQxws=j^mqE#MtUm8?9O>4?(Z%k8IvKt|(vvWRQU=u(OE&gYB99L?3vO$RnsXk)+I%qzT7tps)$HtkOeZHLRa|iaqok(xw%} zOLg$F%9Ol}Owo=pY)NyR*_TBc;|Vx8m~s-72*lQ%45^1-B{7BFgQmQ~z79h~u}2eg z@`fR2w6fPhnT^t94<64n_?o6Ahg`siA)Ud?T#%g1pV443Z{7|YC-$#ID>NtbcZM8; z>lC1p*4&{iKCy;hmtkaa5A?}3^v^Jw`M=$RnFDqSqqw9bPw~YT{zp=YaV^LKMjjZx zQnAP>DdcU#Zkvk3+m&`)=-i$hPLRRDe@{;_#EEj#F5)}6BhCW%5&@^ty5A5hqYTGV+wZh^>sN|(2 z5Tyef@|Je-2d@?5Jr$t@cYU-Oa*B=hX=knYir!GJLlp2eWhVAIE?T?!cRUeUc&YB^ z2-tR%*o9av156~u8bGQQCw)hWQI?Wng_2N6ovd7dG*?QNHIf?;WX?Ga^$>>)bhyx@xJ&Z=GYhW?l3r3B9E*58HG%h?g)>Y2Dbd@&HGAwF zbzU3lFeRxT%4g0R7w0tS&PR_-T{eV(qHsWKDc*Hko*hBD3jM5vdhcCJKOS3ph&b3T zpSHW99Lbh_4_W3(-!?7;=-4U$Hcz??<20}$Pheja5@rXD&GdB243SlP=b23ut*6pQ z4-mUGqZlID-l5Ah>Cy4ldDJd`_Ax3gs*cy5qOUOs#X?2n+IJV_I3+&gy$A=A6e%Ar5biTvlGDw*@DjiHKm6>Ki{{Z$l)QQ{BTiX0fWV9Syt*mzi$ zCr7f4HIixts)3{>@sFle8ZoY^Hu#EPUW!(+A66JlvL=SYmjuA%(A;`PL;i2;t6fz5=Ue z0{Nor-nl^*W8i>7nDeu}h2kRNk|RcGADp{U*2pC?$L??i4&OfKmq@Cl;1=hPa#BuZ z&-Osg@;*v6U0Ximx&j=J z;*theI@ZBC$~d<`&MH-z@uG*C?ars~K9FZ~ui?_c+0;CA`k7xkR>w99Iko?P#BVz| zw0$9T-^eSa-SqbTk}eta)JbI-4x)$jvPmJSpym-BoLw#~J015w=0Uayf|ekc*h*Vf z2iQ>k^D*mM2)ex>U7a^QjIf>ekc3*Bx^nf!gnh+0b{GBPT)PP+l*Utiw50a+lhd|K zZ!x4?^C3&Q*G#+ZXeNYADWOj!kx>spnIpQ_Ts$p=hf;{~pCo$MsDU%(NlMJAfo0#2 zCs6@FCcS$9`Q5_%xF$yMxU$MdWUf+JnDM&zkvH$Eg}HxVs5;BTC7bU2-owXLE|t%+ z1Aew=*+BN!q+_hkhzUowYQJ$(i+~SGmL)l7`K=rWsKQ{#Vwd&`ijfU;p3#m*)7Y@0wlK& zHs8w`Red-ogvtvIp)8L`)5N%*I0fLKp#Dj?4=8-Ndh;DLL?0QO0+R}-gE-&$>Vy71uykd%K6frTR-|nzQnO5fPWI=PNPWQMCQhdZ|70Tjy^KS!F(2{(2lM5TuaYX zJPGA~PA1&|CD#B-7-f63r)E7t1&sStaAXLHr}35+?V;P)W!{T(8laMOC#gGvSk^@{ z9+2x6BFGh)BjhmFUcGNM$1n7$=!#viR{Bt`qW*H7L&~68osmQ*DSc9X|W|nLpAf)|?J!=J#hz*@IN#U|B_tKDx1* zGd0k@B}4({l6T=L|4kAITr zPP$J7?xlW~jligwXx1EJ5bk_?;nC!A;yE|(j}{+Y~6X8!EFRy><^ zk!*j`-C><1{kkx}q#MGZ@ugszrtSexlzH;~p9m&(N)tT<*75O_(k_E7%=(Qosf}6X zoGYhJ#H~~*uZM^|fjvYP8RY@Vw1mkgp_qKMDG^UF)D)-qjVQuqpxPn{WpiI& zNOs}kl3}i7EqF?6Lb8kjR9i_FRlI!G{iuFTi5UaVNBE?=|okHZ6q%JhVU#1nxFRjktZhxYQe+2;^yi%W83 zO{R@6$LNga2tc#5^j)b~7by5*4FAZIf|00$>i(0EHJ23~F^|kSvQr7>G4dtv&bfItqR* zE;-Egd}N#EUxeg^-NjIMa7af<>qf=*y0)EmQwO>(-M}k?-r!iGwrldDghW3gV06Qb zE!=+JbQDh_Oy*FciOkbS(ySx}Dj0)FT9tsmd*egfXp};kf{(htWZ5FSJ~Yahw)WZ^ zAEU=A6+eLMU)~JgtF=;!>G|k)@F7067i`>1vPKHsqV}MfN z`9v5a*pj*U-ZLqJS`lxrs?VD71!uY^4;ayQ^rwcVW4t(H9v}j{to9kIZ zP)5g0dE~yk@tS3Hrc{0$i!uHChHBWQ-jqdXF!%<02K@5UM8FD;pxDCrT?#`nb z%#e6Ie05)3c@OzIm4yYYR@S$)KHPlOEY3KU<)uJRdnlj>3a=&Xk|@+jeru#ybDd|X z+ur+@&3lcN)pDxcbNW5dTnC8WQ1`hI967taE9SlSKM<{a@_UC0`}8w22C|@%jvD?k z9T}|0x-Op?wp=lD`Lsp)zwn6Nt%D)kpL9vK*lv#)*qAKtr>#8gwf^RTO=pceP|_xS z(FS?xsvN5`*AGpcW6MG@*aV~SNq_^?p^7kxR&;~48#batvi-Vex`+9O)63HO06(w) zVN?@!#;m~#)!WRnrGei*^J4BJsO+ZgCgBbjgN*Nq;!x8^%Dqf#ciz700G0+p9*j4P z7*y@~7uH@t@GFz+epaflJ)>8<^2;;cm9H^r@TVpGj%$G?&I!NMZn~N)y5*A;%yij+ zi19;3ca0wm5ZR4v{AdTt|DH#TETe*1EyjuD5Cqkppe{mnqSYBSj%vQ${PO6;l;aX1 zj=e9$HEN-w?wNMR8TU<~V`s(bDo>jt-Z=xP_OUXVV>Ew68(NHJMEK8>2Pi8cFo z{x{GB)Ph;{6WdwPf8g=${MDUaAP%xt=V%@FBd+m>FamODW#1}oXSetUDi(z*_R$oT z_9H_8%n;d?G0B1M43qXLS9m4 zj!Er}v(81sU@|}0@&UR@yDPY+vse(DQyXDNmYu$U42g8@nbjY^K(plvkFS&;fzq?a zZQ)k-$k|6|=)guLObmtGzkOAD%92IOUbo+i z-hkV}!1bRz^Pse)@9V0b0%+p{U!CY@tlQ{L@W?k?PvX_P=V4mQH4q?$Zt3$2Pz49M z@T9hI`<>OSQM#+k#u(P9Zpo_bJ4BI(B;1!s(M-p!w)&nO56N@FzC=o~g(!_GJBHIk z+ji4GPxu9&R?Z6tTBX=+DH@y^j?xnHcT|RyRl}D)_0f59Xif>oE;*})Q)ae*9JC8{ zb)1QAULeYH>cC(IezJ#MrRM8zsMA`F0ZuTO)O`p(0d=+`;-Zm951Te9Q-k)qRZ zY_M`HmBXPQm(F>#&VOn<%2TF8ps0)rpjVPV^Nug349ucl0VKm)dgcdbec+)WU8>l9 zJc?|q<_jOa`%#hqty~4yhrx|ohIuF}4z5t6ylT1kq8BzJK@*91Ss&|x!@LhZ|J*TD z-`nj46mcCB@V<1`sy{)M?oVa9P)gJ`!`qvd9|Hk-P{tFztfbt#dHLISQ^nVTSsowe zy?xP)XQ=pgwvP`h_g=ih_2Y`eyen^}kB5kUG8?c`uWhWWt--mNzHQq~u0@pgKrcJo zd-nWq&!=YtGM@#!uP*o`Mm3Dmp9M?2kE!o6o>iB4*Iwl^W;GD7VN3Qgs}J|S<@Q|z zzWemrO)*le$JC+1L#V9YhVhraUOk+$Agh9?|9-sf!Bd~!jNH)OQAj@RiC%S>_knZQ zP34o2@$k6A^+QKBlzP{FcHOabRIEHxq~4@6I@A0kl|v8}wnNBj1uQokWL&WZwryD%fYc+%g%b1EX|&gF*%uTDttqmCuk*e(&&M`T1$yBBJ(1|#c- zQ;uWN^ye8o{lCZ{H>Gkz462t#*HL0WB}l`DKS@VXvkB30Xjp(6G>)sTeY@xhRjh`@ z_tFt!e?6}c{nX*Xn%;H-sKY~(30G44?zS)B#G{0XymqLQg8W`6KzkHhr%l7s!oN*G zHxjBmW%c2V8r~|F%WgUMt${4&u}YI~>rOgK{>zb?k!{`vDo;K_>}y$-5kfUORF0Ye zh@CJSf*6h24u(?g`rN@E&bRbEhwgueUMZAWP<=&jS!_^3%I5s^QQ7aFF_3?e2eyWGQDH%y zJwlv*%{1luIz7_|f$cB~B$CoPMI97iszMoeNFu7aZBm=|-Lm&d?NO#+^nR7^NDL>n z3syWfh?QCM32H#0XF^hYVB6PWeggBc{3f0N38UJt6VMA0jkV8veZ2Ei`9e~g{oL0l zoWPHARCC`=^o^X-8n@LVp7G3CC#eCsgeo^3G9l8$_Y8kKAUvbLzi)@-Qp7W8U@l8nQhrQ_bP{RIL+wm zzYtlM64&*r1+m?02r@$fG}^qm53prJ9tD`@CbS_$R3G2ch60OkUi8U5HUf|bf?eQa z@*6}=GX;rtpl`f)1=E;Z*^37Jc{nkMe%n@%j+0Gfq326xj4Ah_eaz&s_I3}K3vyUW z=^W&wulHVr{K#ymU?LGuK+5C_?uzLD4RzV+XW9)}**!sy3+;kiw)X%nEiQ4d$L%_3 zmIv&&L{^WSi_DL(pK9NIdR;Y9MP}YoiDg*SbN}5QkP6m+vw)uE0nY+W zG=P{@Dj1lvX3Q#8exAp_!~-!g8%hu*MYR_r&2$5O4PpQhB?EeLH4yk`ZhDksNpgjs zXB}Olm6praVr}jVD;i8Ba=E1}(@D7b1AiGZ8;}nOdut&9^7aE%!BmCVAaV@8`L>Am z&ui|K>B+P;oJx&%InbY<`!{;T-sPyWmx=^902D$ZV)6~rZ*VzW5bQM!&g87bb8W}^ zxBN7lqZrC98XYWB-F+6Vcf0_%ja?58ufJ^)GHTp>WJU? zN)O6F$koaMgT?}JW>vvf?W=p<;^d|Lq5C1UHJvD4?GZy1gsR<81e8%qamqQCq~=Kp z?UfxbZsB|LlM71dV?R{Fs51Lx`w#<6IQos0JlP>a+x*^}2U=(1hwXPd!p=hkk^`7} zNy80ja%C-c2IkV?xfoRnBs`tMw>#_PUjpGmf)zZ4LNCKDV_Rcmpg)`(o@}6s$~&uv z`bn)Z9UUF$v3BMwi#bE?$3WNLjNRK=mv;^XrEd+=PzFgH7?T+*hc-7}1wLp~zFC8! z>n3gM+|!Ecrs}kgjwg^bN|7ie92kI51cv!QCy7Vn<|clmz2P#9jxWy2^uOEqS6OSSmy%7;A2&bURkX4OEeIXYfMUN%;k- zzG>4|e)-&wcI4{B9(EAT5LyE+)Q+YoYYtS}W6@K2j*b9;Sn}2|VnI@r7V^S7bGRFTlFF&)g89&Ypg16p z2^DnLc${z7wvB@eioPe3*G!Gb&{NPrP#zS3gyU8o1Vz5pD3t4sVYCfv?+BZigO@Y! zFw^NU_sTWNnm=V!y50Z^(mE_%W<`7L{hJnC^rIc2$-*ZA2~C30$N&K{W|aQc-gxoj zL#!3%fvyf90h*SQPYs#$huF7%7;GKNpP@iZg)}7^I|2Xq2*kYJWDkz*F^&jCK|?W6 zq;AdXHC#BTGh~Sl?Fadkocmz_>8`!}gvaGVk3mumL^ecFNCf1_028W|iOZCFrma8i z{vYq!labkpvLD^Z+|0_EY2M6YWIp5ZTWUaTI&5T4TZqEyPks!^$eaPn&&(*b%1x=jI?w6P$|ov7iIRCGLIZ%-NIH7AMsK>x{$Hp>4d)lwV|#p{gi3A<1H>90G_cQsqe| z8IQDQ?psAQf%4~Tow=6}6o|tl;%v$5(xucXssog`KblGq?>U;Bb0CYk_b_Fd>VxuD z@lmk6`d59tfphe7xsVMdj8CFUo>WI7b7k0$yw651ZXgWCAz)5VJIGIhix&Qf^$> zwv=yBzG2vhoaTuSRk938#D#OmELm z0d=xPZ?b0A*1s}quqn)@Lk*LHvZX6rC(~+&{MZ1)wvq(E3d4`>Sa+_)h0}peC({jK zR6Iygb_+r}Pch@2er%AD(xd8Sah483DNdQJz5n2g<6N@9p{LmbzDXXdPCDsjdHI7Jk`{yz<&4T&p&fND+^3pnLOByiI%Ext3if; z>?4BsskQ{_>W5pkb1ymVHg_-)vZ8`P5GQXG$>;!-Ipj0gq>2$_Zw#tEGkuLk2RdZ1 zy2Xrc1CSh~{F9SnEJPOHP=sRY!mY=+UNYjf=^Yl@37pgER<2 zr#Y$i>GkVvF&yb|B12cn;ZndFlW1+~sA!lArIyS(0V693>f5{Sq;_r+t?fayGh%jr z5alaHTd{N!M+8xa<>y==?Syy?{YeG>OPCD1T?fusE{H&gmE3DMT(qg@U&^)Sf6!%+ zz;^J;{=myntX9HT`keJ&b0e#)s`Sh>q!OL$pn{hRsR$2Kps?o2I?%IAAJ4(?(*fEE z^(Q}o^3`r&Y*20*xs#bmKY5VgAGDv4n-mi5DMc%%Y}w(?NdIBT#vNA1a$zrTUF$lN z7yR_-LXx{3Pur$$S>cYSYfTOhKpWZ+FW3>z`h&I=h$c8wJgIik#ZQ;JGKld;w%}h- zeYR69hNus4D#p@oeqz0a9RDzb!luomtc8CPJ<21oXr!4kokKcX2U77Shz-lOyv0?e zRqm`;bZ?C(&{%5L=i4|jn~U$-zwp1z!X^?ts8E_CxbHZzJ6iYg1IiFqrNj)aRQvqw z_vaJH#U;OVt%6x@eJ?96$>4&YB;Den0?J-A;g|EHc3jV94$N-WE?;-UdyI3Lz6{aD zST4HDEMB>ao8ieqza%-w$0gA>1N%8`ti|iQ{UiEazB@<611na=6Z&Z2?y2G(S9y2!f@ET=LeYvw4_Wnj@@4 za)H&=OXk=jKf6RC!t({<*Ao6T7g4hP6gLXbnZRj+=zk=$z74;HjESQt9YT%i&d3s_ z_2zk3cHxtsDt4aDYwt`5xhiAM~#rZa8J9iH-3F%q5( zf)j*Dg0G(fDaK&W6rIKuhKwJyn^v!FVq$cZE4x-JPi6wBkRjQ32bTN%P*nDyk|W?2 zs_X_g(44>ZdFpMY#1u#|;RLb^s6?a1bgi&!zTD)!5$`@X7 zo~&ZYHQ-1BX{%0~#T}W8WI1qJa4#E5hqIR7uHb^~zZAQ*PMn;?g=o>o0jv|bLZd!zataHXe$};4(pfC5 z;3Dl5mz{{86s0!OsB#pIx1w+Mvgyb38(gKGn7jRz)I@k?CQNK?OKF!pc-FUaEUMg| zB|4&F0R0YRk^l;Lbkc>A+LU|G9l~ha167tBUNCAs^3D~{2!2|bqptpeIZsBN8dNF; z6$1$hY*7;NE6MSgLvKAbs$Ko&B2|`gP?qOOZIStWFg-_tzgf0fJ8#xw+<3C6Vu)N} zPi_}8VVw5bj49j*qOd}vCmrcPxEp;?BK&4e{_HIasldRpnJfQ~PwPuU&kJGD4 zExK^?5*n=IRi*Zn(DieS4)Ctse!IMid-41zSYW)t>FKr%$Z2OhBKtHCr#BB2LtS2^ zMSu0u1!v1e@9mt|beU|JGxK+hR6o6-i#^q7#tZ2ye|_eM%*Hyt@_lFmFp~5M0OpIA zUd9y)D)yy!K(35;l=mP$j*DDef7bg-f>#;zuDblzL;Qaey#qEm z2P9*#Rp>ZShYl1C!Lo+NI+}GjkZ1eFQOtPJ>Uj@%e7!~YKwZ_S!@b|E{Ad^o8uvKv zH=}g?`NV<`p7!8~w$o@Lvr8X-VKW2u?YrUn>1b_%K}QEd)Oljr1=pdEAEujQLrC9atuP%Jd!xjdc@W(bNyS&Gx`K35! zm+;&w_EYUioAl&bUv5va2W})4oR!Hls@^XCm;~k&$td4HQ26u=A%q(!XB8Z*C+V^R zS6Othd#ek85WRH8)42eiB`(Y*674@)e3u7Ka2#UR4g+4%S9h>F z2H5^fGOY^%L9G~AX&x| z*%U#J!5@IMbA3hQn=}@|)xKSx(WlgXR6RDxeCgg|uk_#2p%^3vWW0jWG%?ux*+H*m zF+?WOa>+Jdu-UbN|3MOx|CU0Ou_0PGVFLD<3jMg$|F6iX|DRi}aSr%1Y}qhYh!CV%Urh<{FpA3S#?+{y$D;TU+MK7kDbH5$O=+NxnHi^;C$iS9?}izDY|oyaA|Os z^;6SL9zwfleqzVhk&rI1O8_do6t{VbRwqwxy#kfD}P5UNI3Taxm4$U9G-{@S7RZGBB+U0G0lJA2)y!yv5;u>Yu!4pfCIkN2MY z)QkH{7Ej&oBo>*5+406N*xUuo(xQ?Uo7nMRUH}OM+vGyb4#^;9!*bqX5?}vq+L*M7 zeuSDTR7Ex{lhDl}2cbhBA7|E`wPo*q_Io~`Of+ylmB+dn-)b|Se^=gmuAocpiqgO5 zeX@PxztIC<6TX%911LR%Ood#fE98{HhsH#dZ_@`D2In^wbLvtmB@4Ada=Q`1qFlKY59? zT6~Qk=3Gn1Ms*plmF@M3!|g1ES$wzYa~ z-PwqF|1|7-~Q3_yJoDilj?9pY>=!K7_@=IMhOq3wvXorKJB$Zn%~!D$nz zbOvpp69v>IlXp5uwMA3kv*b(eSC;KH|9>J|M9vX!F;+d=&iB7U* z2~p&ErqNV(}Hqt<4 zeixa0m&Ux{44{K%i#rexoz5wQPCkirvBpT=B)qK85@u#2t ze}-_R)`>reHn!ti!oG5NZ!ccLnGI3|Vj+vakoQHt1hniPWYg_W z5tH#T8VZ=Rne?T@AsLg!!LY~5kPLO!az|v`_QG6t`xloS>B?tn)rcAJ?QBHG??iWQ z^y52B^gw?ew5HQGzP093sk`mv3I~6a^uGcw%KxMwuxLxt_j@6D6cnl&AJ@*j`pn+g z^x_hK?twyhS>C6^M7N2NmR4=W{6|PQEG}`Uffaa9ip^Ds7Kp=p9X%B;X`^}gBj0_o zTn^zL6;Nq>RV6!)OW}F65Pxrrr^0d#m#kiY5JTb~*7|39J9tV{1U>wkc`a;4>m!PF z3mGgn(%QIfPX@d!x?0ovpY@0$#w?8o=TeX6_@r<&ragM&^D<9M;%kg3Li4|HGrHv@ zwFNIv@5VI9-D74BIkL+5OvXd7R3A>FRKcSQE-l4^rAce(uSDOpH``IW*>o*|RgMQ5 z)sJG4J$UjYkq-)z&^Emx%hAe}{L$!CMeY+EC2hvz-<~dy;eNSKk8$=8lxuidv?UKc zC{sk_2?19&&c*a8H$Nfu4hq-hT_I>V2-f(VX^;BA|0eoMVRI*j5sA`V8;Nk4I!ZJ} z5EDX#5kr!oN7}kOKW4|alJ_a(brMBeBYOCZm!BC0l=hOq7=3dm##@!rp>0`y-%*Tn z4k5-u;P^s4ywqfE!IxLBCUE<(X_jzDQkS-L{_AoP96sD8x{-wJ>`zZUvB4(L3cdXJ zYS`w=^x9yMd~bQ9cajSdf)Q5-jPomORK?koZoIZ@4UBUdu?nz$=ZbEvl3y?u#)zk-_)%GJXjc3tUF34OhY=cvSeNC`Z#{(1`$+c#l6B*N z#eW+^;9|6b4W7~(jx~o`%c9MRIy#J9E7Q-14Aw)fJiw%mCZd2>kD@azAeQ$hGeYsL z7nX8BesPJrOl2)JnSlg5OH7aQgdMXRK1h(cA4j+;5p5-*&lY;eb{pJqzzT7b;+?e1 z7JjONwAibXo!;;bhS-yerqJT%)kk0821C-Zl5US+4q=Y(BtgAI4@9M54F8keg)g(U zQG0=f48QB@cmWPO5W{_p5M0TcnwcfF*S}iVo$uG-Iqp|_%cYRf3@uX?X5&-t&_1?C z9g`)r@7EmwVWd6o19#nN#A4GH3{vR0+lEljSkq)yWVI`vyN7LYMHOu3axrI-sjH)* zCCF^;TW8M3lzN!h%`#}#1x2@Rp2j~vIhGT2ehq!j@>9@Js)zZ&ry1guWNCXM~gklw3 z;J~WWoaUc}w8qS%Y#kZfiR>fA0^C5538RDE+JCNHA^9F3U?^wN){{n=kFQw#*)=xa zuE3{TW{tsGkNqqE>H;x16DVdrI6RO>CTN$u_@Eq@Zv5{pd! zD$$FE;;S=646v@wXhb6!mj()PX{g%!;c4BV_!gP(cyE9A%>XIB#~tyjBfZzny;hoH z6coGwb6)=oJ!qx`n!~lU_zp+wMC#5B3GRle_f|0}9PUbo0`k?o=rWWogdZVePn)}S z-qiM#EtTAto0#t@e0J|0%cM!|`g`BKkcKaU@1v+03u|IF_x;Q%vUjE-Z^BH%t+=)A zUtPvju$MeywxiyyB8RI0o{N_F1XYz-o40BOGs;|^3j@oQ@d?rdBFSzBxn|!&mICM% z>{!SqDtDJ21((~wVciHZR#7|(Pv3lZm(FPNo6)0YO%&M*7IDrSXUcB2L(KSD_H{11 ze-+|q3CH`0A%;E0D5zq5Jb&gDkl5*^!KM?Izn*@@_rvISe^3;a8yf_L&vwYmL&)uG z2-Q?er&n+c!tCn3o44Hc9Q&;x((@0O?09fX-lUy+jG5X2ZIa#W&IsOS>^tCedV;kc(*YVRtzeESu~c(WGmUfwYd% zN~BhTR!XvCUI^0qrQt}Mx^nf!L@HGj3Uo_D>(_4Evg80(9clS6wDvO8bsRLGNd)z( zU_+oh&=9~8g31>>j-xwt$PLz$S<6;j>48!^P{n>YpPupTL)EO%OOSZS4Iuop;q5ix zH>~KyKm*BSyh(=Fke!^nUHdAL-edb+o3-KTFC+;paV4&f!6(~>%{&ICF_Kg~|Kr_7 zU+2f2Jbym!-`tcNF-6KsEsG#+n0_JGB$3uA#BA7;VAiktQU-E&jwcuKro@VGy6|So z8Yz;V+$!iHd%5G&PX|*G|8A-XI3N7^j~MGRcWBxkx;IdhZJ#OZlQV-B1ct zXrd-%!uUQM#bZF=M)kViw~S0aBGH3B6A(yUCv0 zp23{?5V~QV=_0Ky1F}pc)8=H(Z}A%9K{jMeg|o(q3>RC`kr{${j$}3Gh?$fnKL)dN zOoT9*akR2A5#qXrh<#6wbTsfS!u<_PIq&Z6%P2KVnIv(ZEF3Fen(+aET(?~)}jM+s%78|i7zIto`_;m5D zGEFF7T81Ly@OG;5w~06_2@{aa)~emK_{(vORwhh)n8kDqza+@ts?U+?M&e$BStW)C z1NEf%xW$iN@wVi7?zR=@ain!4a|W504dDs-NtzVy*OH{3A+3=6wHKDXPMM9pIAyW3 z#7!c4@~~x4(i|ctMfN+74PSK*$|1uSpN&kR(%ejr7v;Zfyoe)yv+tOUW3+JL|NrcL zd0-S(w)aaAB^7}-AQZTl%Qu^jW*ldIGn1tu8M93m7{@o$6Otz65t2-IA~J9JL`6YF zMFnveK|xRf6%a)PMUh2ibpv-tQBe`xK+x}Z&b_zx>h6Su#m|3~bXDEu++gKk z#m!BLzH(o|3EhkB+S2SG5gzo#pFF{fMl!sx{15#{ZDU-Yy6mmFVzK*cJ@`YI8>C_} z@x_nt5YG^iz|TaSk<1gFGJ6*VPh@1BqV?maNZY^_g*9u5HZ;`NMH|Twckj+gzv8$4 zqV<3?I~qG%YFcr9{+6pA5F6=tDGE=vi578NLj8izJS!fnQMME{=SQYYSS!YVH11|R z7gK(F%}39RpZh_T!q3)>H(Yc%Nz|W? zVEYcmDVk1A`jT+gCo@qA3LP7D+Ns`?C0E`-5U@+k3O-zcr8D=|-EY~<6<#bIvYy#K zFaT_OjJGH240~=Pk1veYmc~&2rv}0xNl|d7*0fTI)>?hZh6!&90Z$E&Do7(g^0`OP z05|DsI@nO2h(6b!dS>ck@d4>uEXG*Pv45W%U|W&=#<;CFMqyTmryYt>WD+ouvi!}N z@VH3J=25`#XGblv;T-WD4KWgi8^|$)b@bVsY3xDkCgkZ;v|en~iAXpXk%^{X@$^JS z9+h?vBx3XxuQkVOT(7Pkv+jSGkFq@^5m0CW+nN#lIixy{h<|f}ED-9~Y@W7TY$!H3 zCs8E$LJPdX`A!Q`6*$1sVaefp3)LF2T>%r-Agw|RCeEznYfTB$c#P^o?E6@{bGGIcm*9edpAY3o5>Lt6D@)>-NOoRmJ$#|QAUU=C-J zmiCUr{(l-0{hO+5BSWeiVC#o~5{W~07!lQ%U-`s+g8ZD>9@auiorNUY0JjDrA)Z}> zP&TCGHbv#rqksI0+s*Ss|vh)JJ3bhDSDkAx6cy@QAx= zY>H4q3a-Rx1hz}jk?c{0PuiiCnJoS560cWoxk=XSPv5VHY{?N+zM8XRvvioR?oW>rY$8pAblXikKtqB8E z6Cgb3jzHiMD`#>2n|W*glgXZ!;)+Y~USU5&d*!y~IFnzR<9OHUAKbX@X+dL7hsP4A z0rARhn*FT6S}ovwc)G=80-<@UubOtF$aE&%#|PlFfD`3G9jS>;e0$gVyd;z&-&Xe# zQg?e4mLc+o@1byG>j(%a$5^JF!bn-9th}_cG_SNM5-zEtte_*b^qhjwj1WbMg)7QJ zZ{2hlnZOJ4ipxTeZ5^A2WL>T3XAzbBv+|4Gedu{bUS(Nm&FGuc=)20ive2^2yV5_a z^2rs)id^nFuIWXfwHlY@{}JMzu;QrMIkCqdCfwPeKdJY8VqeA^^5uL-WT6H z3Z}B7%?B0Xq5uV|mt(+vaN`yJ88kpf0-S&4NLsjU%=K*01(aKHA(nCBL(7)PLQ$9s&+)2~2io8f(X-SDNGSh%6 zt11LdDfPXKP~~RazP^<*F7k>>EAZ#GS<~hd-FlXU!}%2vWT1tSmIe#;;_-J*r$q51 z%EBf2SfS9Dv$lt5b;`qkMEm&ko3WQxz#EYzx^bjptXea^H;d}Fo1bk3_RF4)C+79e z>E1pUIw$!C+~Dk}93rsFA%HUUImfR0UDK)BjY#_QF%wa8wd0m$fyla8S!waVN-dSh z-|tGC?032F2(9~sK`0_DYKgFY^!&1qMh$=-GS3l<@ zY}*v5Wg*wBVK2F9jSOy1AksUV?5M1jXVbNw1Ix?uY^5Yg6Jj)aMJ5(NUzj-|$09Ej z3S!3k=y~gjv{K>5dN7OT55`^oo`BC|4<{5!eneKkdak`i!D~-_xJIBf(LOf*S39Z< zjaJxS!A3gP612)n%aLm!BsBob3c(Kf;Z+q#J!ip%-Uz)jcJp6ImZ6^!WeRzQe}4S= z6?YT#O^AN42$v5cVU3@xS@-$9X?&-6CeHU34V|xeb9#IOduL=cX#EC8TL`qLAqvf* zDMsNTDq#i5(4^VRCnBiisyDYXT?K4mVAVDd+>zeEuN!~Uj-uXbYbhE~^@6Rh3>2R& zd~FMF{Uoh>RVLB?Q0-)D-*Sw)Oh;y6?4CoNej0t<6;FR;>)E4#G7C^%D&sPoduK;d zV(rlWAR4L?B>Ih$mo?CK=6Ra3iGlJNXF3N$T3b`&ejN_Bu5XDxYnVf{-ZaX#6#)*K zJzYsYd#haQi$2;_JtwFqqe|1QHYICU+cuHSD)II;{-T|PX7lT->yXvcQeT7O=dgN6 zTY_pI9&IvUtDp6&R$e*W+yQ}G14Hh?ZBy<$qm>f5;ET0@OA-$*fVzLvvShP%2Epzw znZ&5y^8US)TC5K9F^)j z{i5BQcBZhl1~Bt5O{YAf+Djz&C7xa&Rg3vbCES?-)g$T~Miq`g?5XMx;YdUISN)v@ zZ{Cv1=!=-I2~6{SzByrhIv%tTt#vd-jA49+gW=Z|5mLu44?3^LASSZt%2PDrL@fgu z!NL%#zc=ecmf3PO6!qFYkPXYh>@%*NYSO1PR#)9v|4+83wxbWIKq8WbOv7v6ylFG9 zHb-O&*^I-6@DLb=rKNz0=??n%%3t`5Pu7|8-1*A z-7>G*WX#42RN|!G2vj(yMdYbQ+rVZ6hX6A!E*#jQo2y%f>5DIZQ`D;zA?UcxE~t*x zGjbp*)#je%>HShQKVeHE7AL96U`PYo~4~AQ7thS7Uhtc+sq}T zO^@PZd&aQGRi=aoo=r$i=AON3?3}-v>>&4K?IZ=B8Q6_+zu+0}@wyJ%K{Vh;P@~CC z;Cu+ciihr(Vfu@?sZo29i`q&Ca!OF`n8rTt0u(_cLCV|(4#B1!!|ANux&$#Jj&U+3 z9vx|+5bc+t?#l*%!-?z|7NO+?Dx)KS!(o*o-Y*kLZO=ZHrWxKLw^TG%HzVY<<&Yu$ z3~|Ajq%T56-^Td<-8!jJ{9Yhz*ePC&!bbIt&T?Z1(FR#5BomXcQiX;Dig8nwug=&a zL88h&GC~xy|AC$KaxNXlr#p)=LSQC^-&zA;HaLn(?U((sFPstbpJUUPUi*cN4u_i(v=+uj>ljgG_O*_N8DEp09 zb<(Vs38mlUVNkE(H)R`5XWSrxH^shiF+fz43C2DL4vyPr0YC8K=%mGPU+PjJJR~pm znJ%s2fQYWCiGJ=gP$4QC*exL)d1-XY8E{`276?se9OF*f|21rdW<6Ng`UllVN2>9+ z+0^gPQj8o#Jb+o)y$Hx}sHea6&Feql%0-D?6~;(5lq%B}i+mC#Tn(0D(WRCtt(_8z zTz~S*ofnwqqF_6iuL+m@(?6!c%ch+@+aNzXY#0EogrN%{cFLHgUwY{xj^q|3@*n0f zVJ)(cQjG`=Itin1+PI1FLlVO`M(&nw;9P47R74Jjv55p4mI zeVyth@OJPg%6V*RRYP@4+3>ciAx8it#&!w)ozah`WTqZr8>UCJvT8g;RCyTvtu3!V zl7js^faw1ttgSY0y7z|qf!5dVZnx#z>YrWl<+Z7F9>8Q!n3~)ab{{`sCQ{OXS{dY5 zI67Atdiv8ZZ5HX*i8q_k$euTQ7lg{&5_NZUx^}FiqZq%12v{*5{ngd?U6I06;kfAI znv$AIJHr-=*%KnIEqT!DRC~v0N5UUQHW(yZ0Pt}3)0~W(gdV81iSfCNH`xEODSg@4 zCrXnaGNX*A>1SC%-p>eOaES;`{Ps8B*lKkL9W|qt=P6sXhf;uUs=*clCwyS;Dl6cp zt!(#vHpZbBWCn`NMCaBJcF=Y%6)Fl)%vecvOJOqsYnBs^V@$0V9Q3H2A;1IPzwfJ6 zyqkm%Fo-CDJ`_4o+_=8-{*MQk>%}>(suN>ZI-3MAoZ{-{X0SVJOlF7~UB#SPq<=Me z8d6Eg@yKD9@Y0N^z7Tgs9AyRK`pwUbr}XCT!Yk=N6%G#s!)}VzMq?=Osc+r8qKI4M z;8sc_vaqIB&Rw3t&p6Gk%>*Dvc`S-bv5f?ZfEqguk$5X2^5SuQ!Sv@j$Elmhj|(Cd zr51~+b54M5vJNWpA8JM-cHNu=N7wt0!ice@JAl)C^ywRKxH^SMrl4Ix z!FLoYBs&e)0;y4En7jN@r)$Tl-lKR+q{#vgRE5IoGj9LnkF+|8nMvS4E@Zy0#?e^Y z+yvh0u&3>NphLioh615v2a|pK8y=H}*aUJFqmmsxvUMa)VF#HEnZbctMmEKUQ(7-Q z(WmTssysOzku6V5S+=V91nmO$4a`VD2~XEkq^ z(%KX78r07SzB@%fwsZ!?7~2^F6u3hF%`%~AKx28NH29QF4X zzwqF`oH23Ji^;bmUN!KR4I*})7BbgcO|H$2#B8^flH;9zkhV5SD~7PPc9Ln6Bnm=1!?wwb2Lv6JD9!_XE<{uhqY|FvX2LwJd9 z?flN_HokBDLW8vR8 zI)Yfxs#pVz5A7x{GT>Tc4FK$F)~}p2T7*ptn%1zn$j8SSxPY)|z?z|4qWYT4H(8r7 zK-+1M0*{Dk-p8GZ!-xI_)`#4ls`iwal5l6R(I_dw;OAfikiPPr4}NByrSk>jaoC*# z2@-T->31LF5}>UpMux{16F?8*-$@7C){cgWj)1k(-Yd!T z6B4YCyq7z^$3SC(1A)%CJ5Bqc97>1W(!nGM98k~&?i}cCBA}6ICYiRpQk>_b1N%>U zZ#f4Daf>%92Izlpwr6O`u1@C=#8IgLAS~?ji1Ji|y*er#=GGGSDF0~&9{gl;p(uQc zS%n4!!zyKRm$tSvx3*yxP&g^2+R7?tn{wcQ1S%cge{1Y)%AXU}+WeWamBuY$=3*^I zoE1i?uz5XLf&B(CCcxFwMFH=M-P`riJ!_}huDMpubgmdyA8p{mT)-y*UP2*|_fc47 zRHv=D$o_N3U<6JPd)@REE}#9OsO}~1o3mN)QZ1$E5|tKE2x@H+4r#|F6avp>(`D-7 zUqUf&INOxO73Iy{3?x<1ZU8KvJ;!s`C0~dtA%cog7DRjkO#=HNL@*JTA~Im!c=}U; z2*wTi?|S$#$+cwb#%_EG>xJTqn>j8(C0I%y2 z3_%d23P$J2dAH5uqsMU!9!&8*T5lwYdph0Dj3KcEY&rjs6`ji7Ia;?NsD}doX!I%Tr7i4fX2Esn4=n+ z0MLt3i_(2+L*lwm02ItBOQ{b~@NWW_&c7c!U~n7JSw%J9>LJkvJNl#XpnXn<%t|aL zgfb_%0&M^%g0l=h@&`;{`0YPxncx6GQ@EhIp%t}i@1J-sZ;{i3m&MuXAo@kdJph_#3*zIP8eER4zC`wME2u3H^atj&1m^S}la4X*LTq2reaW z{=ogfVc*+D#c*RwY!u4#b|L(T*B4VIdKty#kE_RIgw8F-{pp<#Sk>Bc57!QhP{&Tl zJW{nq?}I(P4F&z2S@yw<%nr>7%S2f)FVDo z(+7kBFk3F__BrrhH$VQ&-n6VEwXOpPl@#WMZk+VwiHusDUp64LZaYwmQRu$7s;IIM zRV^bGT$niY{N_0YgmzyM&Z9PSOG_(5kGu+R6v&Mq2SxI7%5rjx!l8+ipZp=94SLaU zMZn3A6c-LGM@1}pcIC}qJ(7k}$$fktMh0bv=B$}hhFbPL>2XC#nc3!y%llI|mHB@* zf11B(LyX2*6&_FsRNdk-VCPX6OJ8{4uhhe!!g7G=0l2uLFv4^BQ&qSs9GbA~n!gjE z@ZiFd{L;Y{p|`hedszVX6M>CO4%0#fm6c`LHg7voe;7cx^qC)Wv2?kk@T=3Z!<%W} z@B#sZd?btc5qQ`UJE(v2$YK#V$VUxNW5PQl08}=;IB$e`(0~F+01jOHOJ6o~3j;WC z>6QbHLI|9uOjdY6R7}bV*9=7MKc5#V2j7MAUcjwh`Hhm!_C7&0!5ov!?Yos?{}RMayrK1}OLyWsmx@NYPc9Ro#q$ZZ0} z3M#(e1^*xKg4Z=I)4l;<$N*Y?&2X+9grrhLTSsg3`{%qpowO;5u>%{Iw*sEN;OZ4U zm|OEj5m;h`73y;(UhS}GbptB!ahLkLGv4_D8pzBJR+(J5w*{<$!}clKK?QD4VkZ&Vl9g-ec5#JSUtWne|}f)@rQvTrTexNvF1hSl7avntu3DM+H&eL z(F9yqW*prf%%W=-Ir>4c?PP|?EP7#Er$u&eqJQMl9j z#Oz#pEoI1cE#RUsAdXYM}6aZgEm)a>}UwMkbQaMhGtFu>O}QdMQAnsd*1$Ri^|qCF>Y^6>Da{@WZ)E ztXoCjrAgDbL@G1X1BOojYpu7PP^zRi;u!oZ7~2X78v`8Qn%H&Fl>%@C1q>xA;`Tji z>^V%!vJFD|no}yr9(d>Rl7K_l3VY~g1zuhbl)tl&B91Hf-A#h$ovEEDABn;kk?OiS zY++&Vl;*Qt+csYao{=FgL(9ggxuTedXUhU&ePud|8J8(CN?_Ey;oI)ahYhWd zZvbappY_^Tl2`liel9*1!29W*LNe8Hg7(6vtLkUKvMY>VS!ZZJve+QBs-nsQS!gDb zGZ6L52QtJwAmWP(^Uec{1aCvlo6y3qyFi)lQBrDuE42LDdsnAi(AQmNt&4{( zDfslj;wAtjK1NW0FIl)NbPTU7KX;WC03;yIZ_#1vy!ME+U?U-WdP&0y2{KC@!q1po%N<_lY-Ly^w0}WmT2r49Y1i zBAd5*_TF1hWB4$j%huV-dHee-Kk+Ra#A3X6i?Q9(zP4<)RPipHlx=Mte%ZcRSYz;P z56hHFvcFhs{?xwg#>TGN@fL+!;{b+txo5M=wVp$q#oqKQmfp`nPMO(f2A)MX__V}S z76%P&x~QP5noEh=#OS~+$O|iib5)xxXBGtryqVc4>Gh_pA7A=9lLbmQXdp4>n!-FRqcOj#|*^BW<~=C`9k9Q>Tef_V&B*=@j-ht!5+Yu!B@K)Yp`Q!i|!XelUF zSrEvoi4OYQr?3ABk0pT(&HSE8Cx(Ou#B46v`NZidH^B4|WF&_(4}nX1b6duqG)RIR^XbF$ZUqrX0xdNt;DfxXBaFqf34eHy*6 zx~4^JeSOT0x4a^x6d6X5DQF@-03mMCY-1G{9YNQQj; z(#}2q#6n6_0ziIHLL-h)clmhP?&}ETr<)Mh!br8MZUnFh%1YM^)1RC?WgCcYt_m+1$Sxm>;Ecz2 zeE4@JJKy05DvU(|D2DP)5B+Ng;pd35^S-mQx5Ju*{L}zca9`R;f1)Uwvg#NLF9N10 zl?~;w4DqOfHv{japj9NBA`jfYOr|A-D%<){-=em0C0XP!jq<3d{wNs&Mnl&F%(>!c z{ko~Qh;73JM%>OYd=$5y&;9fU%7E=Ajs;*$_--&iU+~z+qs6}B*+5H@yTp9s{mB`AlOSDH^M1Wf${O7ULkttH=_00pUEF={!Z zd}6p9<*HFlx#&EzJomaAA9$GMck>}y6U~M`+Ik&ieyAT6;c%q1vH;Nv?|d?6Bfnl5 zE=JA8obvOm*Jr)6@clGCIgT~pFeWG2#qpwBThWolAs1~W!jc~`dF$B7XFQZ9_+xn# z(NNMZ2nwU1Il2Iuqj7!0?9pTomDhM4mJ&c!cpDXq*+-*4df#&CG)m#}<;{=!?bP}x zDtKR8PnSqspY!HxY!Brj+WHqWbarWc+EoslQZD5l&e1Y!nsAdzGw!8pZe2p#CNulw zK=CXO?~6%`8@N*IGnC{Rcx>gZu3Ed{`VXW(^2dR#(Ya!A$dn1h=@_8(BA_ggJz6~? zQY*y}eac;T9mnHKfogn;Dzu~3Jv)Mtchul6e&gF=+|o}1$5t+`dx6*^r_2X$0L2N> zQb@Ah^RFw8;kJSu$AW*D`$gPdztN6R`{B)-9-AO2pTf-8c#fr`jOAE#WDGV^eevE| z7bjafg#MR{*Tv0-3SL49g-qyDE#vyS6|dYOqHBW-D+v`picZQF{^ zmj51MpOw!-=TcE{--YA5&rW^5aU>bJXB$hS>*q_c5F>6Qk6ysdkZ>| zd{eIFhhM!y_h4pra6#!j{+b?dyA(38O zA1uqu89H)n#ZI%$-%-z*bUXXVjnBJCDZxozI6{ZEHXysm)Eo89<7N%T7L##~`H&OD z7tRdHF$-#O9GXvSbjBtp&KC)^x}Ca=rt*J-}Jx2RrUlw9!ix0`>*rlVs~}ezu}%E=0^lGLJo1oHEtvGGE4R$2m%50HFG*|@ zUupw2tu_h)28glITK&P*>pmBp|3`sWS-yN7yPk}~t#M)h3S?D$YB3!G^Adxt8=^0~ z={?jOr;+l}{jqjTw2`X`LLwPj&*{jB*8<8IGPrReefTngzjYH=4ea0UqMIUC2#ADr z6g3}dibsZuaBSQ?Z@hPEvaRU~;dc0(*|J`x^=4dHc#&&jqxi&Az`1_;b6-Cs=ygUQ zy#$Mo#=_>O=SD{raL|&+mCfNti8DMn7U_3B86Lqa#yiTM(1G~l?sgd7xIS~tOGkrB zUEt^JCZELh^7q}0+B`Tndj}uCfzWnUUmqhQq=>;%M*}DKTUbyu##?~n~ znx29%$JigcM>l)o=gdIbKDs_)bUhudV|df{%q0xojDo(-7tH+rtv6luTYf>O7b4p6 zvIX^mdx)=G^&T_Awhyr%bpW2|?f|1)KY0oR?-%r^cdYg0NVnHMT`$-77zdR>`KUYkDcNMt-v<>J(UQt?Ao+r{$L*On)Cy7B0!B7rvaeJw(cXIZ_MG3tjT$)u-}RX}j2SZ^ges_YEL`89fo>V=4 zOwpwxjX|S_VG|h>bbZ6C0DHgYQ%*(N*bMmiL;> z`jytDc1T>GfBE4odIgInPzLB~ZGllf7lv_U9Kp?3JLJN+zU#e5h5X*ekB3L$8hqlV zXWIVpZ?*L1;riFY{L+SA#g6H!b%`_&H&(#{T8Q!nu@+Z#cfc#kI1#cFFuT=v-SFDG zLVOGsnq)HqX5}Q!n~mNbpm{q6s^1|Y94>-__0OKYBbTnH+#~r7`7>@3O<6;5^Q|8J z@=<(;k)fH{ruEQx4n}u5nbwx3cujSKRT-c_>s4+3Xie#h?cWlJU?QuZg_xZ3q!Nr7 z`HP4B6AAnJy(`{fIfyI6?-G@(p(#(|G3Tsn~w9aLfX?>OLY6w5D<~8NH z6;d)fEs%dW+U$tAxrdL$_G28wH)ATH2FF_v)}gEM%OFW>0@FsnewWy533PNh17&<8 zJVuz|)!x!?oV<*}`7?4|doIE9xTo-8ns$_!LOyOJMfl%p-T68;PsaAOvybF$bX*{{ z>HCf#a~`L?9{&)KY)!f9Ft z%sb?@1-n}N=1rT$DeuWl&3e=pzBW5eJ6bG@>QHUOeC;T62Igk`Xzm-mcrymu(^Wg2 zLG?E*s=H#P%v0|Qyt1f1XX)CjlT+Q%Y|2yU$eU)4$(RKk#R0lJ+rY?BBKst6ZQ3xAm#BKJeI~A8K}QLch<1X1LWQ;EW<0xjx7c#QF?xPoq`dFiFt^RXC$ zam9!fZo0o~C(05P2=Af96}Y=h_pg-d#(eb>f%GOaQ235R5TFgSL*Z&&%ns&zWP);Z zqT*!dYDdEtVCIKf>ofDo>B1|OQY3h1tjc->aEWoVVx>k5(-rs_40Wu}NA?VA}fM#Na%$mrK<=@N|8!d^(wXbs^Ie_nW`|#X%m+6HRm#GSu{2#fL$0Flg!iEyr1XIaY z4bmdoM@!~&uw!QSuLA`}KdQm$iuU9V-0viO*}U}}V^aqL>WGUBrbzPe{7nppnVB7| zjyT%f?{j-TUCCH#9BNvSvCL_i6Z&fVH{{4n6hNxl>5!@XP}7x}N}WgLiPV=qx$HI; zGKCxM6s@;>Rh9H(Mx;N!WiD4%5}wL7sG+&XX#JE4%cO+ro#Uka`lArI<3IzL78E5a zWu;C<*($BSr#74kbd4+-Aqu_)+AQX z8oN+1{a}Z-n1$JHM@*tkR)(4B+R18$(E8xgY=jrr3-Mg7o#-gvX%*G8=DTb99Z^0P z!I3leVvtrRDbIRe#CSM8x+CVZ9?<~NNK<3OD1H9!*W-L?^QB3t>oFPW4AU*eM><}o zfWdxVQmOrnGNKLwncU*`scRk+yWrFW?B1e%%EV}c^mUJE>2nn(g{4n9SIq&h+4unm zQ6_Sa%4RxatPoBlnPsg~hu~GL^>J`EYxjLH>+55A_XU&L-e5-z9o{U{i6}X5sIfIoJ6`N7scKjULv60X+A&I%@jG}oZeLT&QxCQTdzwyp{`+#~ zT+=rerknbkQmcZCXf|l4sY&}5(X^KS?rEFf7Dw!7fk!O3zx_gqeda!&m@>PXiC=-M zgIwor)7A7epiv#?LK&_^)S)^XonpvKLA`DR`$ZOzbhOB|Q)AE7LTZbf?DyMOZ}~MJ z=3qaIY$fH5+lHZjibQQmba$Ckgd^0;uoSKkTGQ0p*rI>*%nSp=?J5QXPYXX2`l30f z*$?jCE)J*>d_Yxy9WkvoZ8WGh^2Xs}s4hVjH;yQXDu1`w&VpB7rErkU?BE;6-eAh} z>PU|Jwkg2|)M14L>#oCU&2Z|TnIDRE3zlGA?H-U>!Y+7<*tNo16yYbJ4u?& zJe6H7!d(6015Ld2!J@AJNCbJ>a3H@x1tt5`ki#czd1cN@wJFT3^9_O>xpT3mQiUvM zJTl7_tGMTWb?bKI)ZR7kaxpchD^pGHKzT?za;EM@^cLvFB3cD{tpoPev`1U`fF;Vv zQN?}_2+#T43^)*rxLWaThH`d z5e#sKJG>U2FoqpBua#;^uru67y|zX&bmXkRvK(t-+91Kf>=@|Cxg*R&-muQ8A3PSz zj-2iLrdDO2t!aQ%m(Kw+Yace!`hxo6h6 zIu_^>g!DN_EeN@>9eMlQJhbp64)xYclHc( zv=F6jqtLrGu{W<-SjH0zF8(D3={p}pM#+e-a;xfl8_r?^8(7x4T5s5nRVjIE#8W^1 zj0@~0f(EsXhR59|Q!pIj0+0fa`gc}qS=Z-y$bk&vXPD!>8oul?$w>!;< zHi3vBT;BT_IuAs%9s)B#4PRe=#pA!Mkfe+vfD7xq2Wt?`NDDq5=!*{q#tlijN zF*w<7>|`l-uIZmNWyTJoc&CZ4)R^|FHCEr_@uaCj33<*_F+GKuB|0C7d6Z(N zRae~_|N0L;l!!>lR0wlizO#73HH-ErN{ME%U-Tdd0Mh#>mVzeHW(_FOEcTaz19yoO z0K`O;VZDPG0Gxz!OVz8`V3P-|dh3p7#Wk0}=HeVx+Zn+IlM#rP?6vMwI4=7ntrcp$ z<>Z^2ng|n4NY47SSMMSWoh4qG*)Z?eUNTDC^NbnoUo z9(~ePQ=>|03hmIT6P=&^p)$jE=U@Wfgw)R7VO6FX#5djb;s=lCl}cs=u?FtDRCk-& zPMeJaiI%A2b$;uxTQh3Ik=WP6?z;xpFT84SlEZEd)|dQiO_>reR<!xlRLQ?97SSA9Ns)YpzNNtT#3v}#( z_hxbZ;Y8?jh^OMOWdOCT9~~FjZYO9xYN{JisYK!G>w7M{lrx+p4Brr7Puii<%$tgT ztcsa&> z1IiyIN)kjO8FvZIj({pZ`1S$D{1&jm1h{0wQq=cc{=!NcdxpS!`vq{>k?SAVzgV;C zbjA}2jtvxQakQ2KN3sTJJ@6rhKMFAQ7t{lQdgs{1|HXSCIBN=D(ii#sfxwjm9-wcv zGlquyqn0H==c;RJFjHXM1JqXkWX17Mdt-_e0#hw@HtW-;Px0ohkCb+*J&UA<*A| ziKpN(^*LY67aS)TH$Z`67BIToiNMyZZ;Ut&-Iq6iKnXP&1q|=z0pep=w*oCog*$Mx~AT-%S2OYlu9{nwm9L?31SP3x~(0?ag>dWO!EOy#W`zLIG-X9b5GM_WcV z#fFzzUrUz42ywsH4ri>+xPIBr*{AYROdyddro?#faRDKR?b#fwzkm{sxIRu@Q&U|7 z!OCLFas8?_7x!gqF`8Vt)8t(Zr^%DVbPU zlL@2y&0E%Jgz}bE09&WBHDfyxO5BsXzq}yXM9bwj75s@np>qKs+5r+7htBof4v@%r zbbrvaI0~)QwxU`}oqql5c@K;GAb}=tzFu$~A=(8%EFMqK00V1U18X>HJ+9APKKoJu zyOdx}l?_mQlyx55+a9Dwx!vZEpLjS^E;t~#LVl}uiri}_&=4Cm!`n2Sk2;`Sn}FLl z+9#O!w19g6#5-vhuF0daML&yig{$^`wS+YQE)1~@H15Z zt*(pfH*RIn$;|9ve4a|YS8y7A1g7OcXe#)R|AU{~iikJ?N->aA%guX9ph7cd;SaP^ zEDXYP!vyX>s5DR1&&qS9DSUS7C@a1u|~ zP7RlE@v+=OQN93!%_)*EL@G<=7okU1ja!qJ^<(X1`Fd$pWiHi9hzu(BzWn0u1>VG&g0 z$JZ^#FnVi8I)44=^H;9miVNl8vYf(ldU4Xllb&Lb$MUKY{_^%GKll}upsJ|M8AvbO z{LItOa@{H-X&GQ4?|XFHhBN|>}=ZB_!cJs*GW3~P$suLiiGuok3#uljGHlY}hu{aKd9V<8z2kzQ$ z=OFmWK3Z?8jO3PkJvfv{X*~&t(k7zvD>iA9VIq}KsIVvdYq~Wwr|`!ZkHPX=GIUBp zwe*v!7}DBDj^b4IAjyfzWtWwBGD;LTJEXZ$-bDK&MPSp0U-A@?G%L@pvWpP zQCxd~3xKm&Y~27%F~Qsg&?k!;iqA9MiL>)Rh+7+rx^UJS@BgF~Vv9T|n8|TCoQ)oW z)nWeEub`wS!0$Zymvy<@o^Z2S{KD+)VuhJ~FgP zU;nRnL^w_`SiVnlh4@sMD|{=YG6Dc?MR#}11{7;GU@7t&D>V-9nI@ELFkRr0uYLxY zpva39ox(gpK+6F1j@L$jDZgs$x9scbDquVMX&EC>0}Z8BMhwxfyKd$$_)7-8hv-a< zhf@%_i-$eV35hj27!OhTy;MK4AH>gx4$kBq+m8x$M@A~BGxP(ClNU%6rjijq<3gkVcq3B6xNRR>YtOR{PG{)fg;0-rS7 zw4-J^Ns5HWqmN$7h}&HSOg?sj<(t$$p79PBD$OWhJBUZPBqK)9y-e7_HcOM|vLz5# z;8ajSui^EL;vWpwtZCiUZ4_AVoIj)CiyOl9rdllZnJ(CrLV z?-We*m@H1#x2RPtP|vcWT5kdit(SLITngIy==)##Iao<%c8c3wwwKe;pokd9y*ISJ zPFxk$+R+47OocDW8e$o4#=N)nWx?xym)f~f9icT!Gecv-2#|$}EJIK($DE2NUwQfD zrxpp@A>D?_t^vNB;92Nd(;8#MQ(<|H>kFT`MHnf5)3#BvwLMP&bou)-26@&M)-CKvYvB=a~sDyOc>ka+A(T3M20p* zFRUL@-(WM>Tzu6w0Sr8#O_Wf(Vu01693va?QDD*RlwlV1O&d3z#&;Q;-zVNHNysyrl7&}cSb*Yo!CumsrTIRY?J?~ zc6?W(bMh-uop^s=kCI&51(0V_l^ayi&C54$euPEpj~Qp-N($xQ<0 zGm)`Vej}S=6aKmG`XQOw!7e(rZ&`|zya&Uhs!MG7*R>;|=ha19Fsi18xPH&=cW|Y> z42aH|@(D{+pX}UA)egHBuo?bjt(SV(($w4x(T`u6`T}pSuENrOns&5$$@GfwYa7OX z#u8Z90=BaMS?k`~%m`reKx|$0K?O7KU$yBxRBdZ{|Js_9Vjx%H0me>SkW65&c28p~>0Ht18yS#jtO$O$3W|3@OGk z-(}&ODtyEkufk)E@w3kyscDgTv|%XPZyc^{9X7ro0K=T8*=`*nB|&X`lIDq$>Tla= z;kuIQcgF$YQ96!1Ta>)P zqeZWdA(%3$^TLg(oe8!70!LsY7`bqG%|C=Czpx#mG0O` z6%`(Sjq{PZiVC9`63WD(hH489Y1@M@a3*J0QNWEuW`^Q|K^#P#KI87E2+Xsq@Za-? z;GQx5aOdRZ^F&`%@|s-UbS*)DuG44Tyd%P&@tuq(=0{7H?j$Fu)Cc(q*cN^B+4d{4 z`3c{e7)D$y1wFfa&-U*8jBiWa9bhK)Lr2l0l~eDP8YbPDtgu=1X8VMiDO)(zA8w-Z zn~IEL!-8dBuy>Pg$=szYAQ92%@<4s@!S!Tv#YZ`d#Cj@35Dq-m%5_2SicvWheffi`g7w~%A{ z!J8Hgz!69khoss?ET;Ubj4Hvh;>5eoYRmP4x1Wp6^>D58d+`H`_aT{~S(!M*_MH;=@h z^}kxLdUY}3o)95PC=_|=F7n}LX8)~CQcGYz1dh#wsxbQqH==5D|7&dqPuH`oOsxx? zH#!UXSwo#0aB#Sc2RR8vwpB`7WiwP#-)eHsTvK*5Mr zHxAeDox*yOxW$-T($B`H>DrG~bAElh^rNgFYW-@Xq6V~#OhSy((CYdIs*}2D`JE)^ z$}*``)?R?N%j+0##-h#D^)Y?*t{pO}hjyD$tM$njjf$JNv~hrFF$-;+Y)OIn;Q=|2 z_uz76uQD9VRMbw?;e%T;zcf;Uiu2@_-1Yp8FQ#R6*A5px(a?k$d;Zrb)p`vejC&#L zmNu62U=TcTqSeKKQYyJuRhCaqV{{|s6_82QNN zB8PQ^jYA%l-xSzjkk`k5&bbL0LSQS@`ou)YE%dusYh$Fg714%Z+?11P7+& z%XgJ{mjMw4b3>tF{fXz7vN1@CcL6#%OLt)N;IKjxXW5Br_*{JNtw-|_Wijt)tt;3h ziu_I-H~VbNKjN8|@l5Uqr3Sbcxw4Ar&qTcwWTOJBna>dI^NF)SK!8!HDyJy)^ujNH399y}$jd>57~;DkWu>J> zp^M)+&0q9o35t3%)^*{shJM4R3cbUVIa$JOIzi$bdsPo{PRVj%)`iqx+`Ik@ix64x z$=AmzVtYtKRNwx|OFzQ_?k4OJRjlr_g;ihk?lS_YvTg1TF);cs*=Y;-YOL0JNE4#8 z;pi{D`pr1OINElhh}NY&v679he9s0O^{D!RMGNM$=IoWG&qHM+m2;TJRcYE!0=6X9 z)JuJe`cyVS#O~LV)l`4;^1HJ5PUX!B>PJyy6;7cGqWX*tFHuIENGIV~Ece$uVDkfG zy8yWh*kp?8@PqXlR?TZHtmO#)fE!NV{@x38yUSuuEn08rnwG&)yae<0rmtk}u;O-X zNi_zd4yftWtq z2OTdMRRY65fVhrLN47z1BN*Z+Tw8zan`hWcC!3}{XFWBx9Il<{HwB@8NWONuc5J;; zh+|QQ|Bo{qro6s{=#T&X$EYg;T8BWxK4M1;aM$Xpfu`Uw}07DHw(aE5mL2qe}} ztYxefp->kfVW6R*X(R+Ap+f2to_pd1J}De017|MO#0F$UjG)4k2w5D~RIA_r{OzBL zM%l3mUeDxt?|1d;JB)n)TPL0)yb)@uaFK~* z&fd7u<^1CMH+w$mP8J{I^K{0^^iU<9)7;!JN-!U@3CS(3X5M&Y$x=FJ^0M&lf>ITn zt7$v)Ousgqc_P$-JZ|QNVA7y{yVYp&x1`1M$ZZq#EZ!e{7B4e9IAhUsu^P9f1@xFt z(eK_K{ns)ZnL5Lf>uOFPwWL&`C`v#S`r_0t=JYamg@~n2`Vsc?nQGehD?Bd7=a~>~ zN^r5RbT;DpGxvXT7VqcjK?*LbT&$(yOR0F}drW27Nrf5dfzBOOST};3!~X8sh`P{` zW@O<+TAGGO8}&(#Tqa^th-)y9bG>2AOViHsoi1sHK3;C2DGt<*8o}{cwqOzcwVUtZ zNP^7lVB{26i|rdTprU^oIA*^EiZ^Hd)Cm#A*n zVDYMuG08RWT9sT19+mAG|2JT=>~ry(?LXkrNhBjl6(! zk5kY(BGpD773I;r*Mt=e5Bytq5lpdHkz{?%?r}reW79@cbo-W<51oA}hX*WWMYKij z=So-In-ru0{|noQYd=zrI`|km6S^p2#F$rVP|O{R8-X!H?${6`H>gu`=BweDo%-^2 zqk$_h`z$dW+ny%izZdQra(nA9Or81%li|ZM;v;FWgVOp0=DDA!MxA65Q32|iIc6Xs z%df=?`qqyoQ_Mgj(SvVm$5+NhX#v-a)U!MaDP1!id#xHixD31<} zA|Mro^_HZ&hTy$awc9q}Icmr>1L1ssRP~Y=7oCdBOfZ)zo+DtRYF`Xf-k68vz@O zAtKa=O`Yu_R&e%{$qv6$)LNX*CHr`bOUd4*kNnl+wo4u<=4r*HFtDa0+y?)!iFv{# zheWLwSO(+zv^}%g{Fs?Nu#%NI=w3na|p7Rbxw_0vV#6&p>uX@?7?GuM%7 z?Hm}}oXi%C?Oil8Tmo@G~dV?Vc89Cp>H^&5sB}vJ}XVP;eWUUv%#Z@r0I}&5ZN`_bT5pE*8jk;+*1IR(B5^K*()GkgY&% zV#tlh-umQs*1ke%Wk~LnEuf~OUvl;2D{LK7x~{tswluiDBTGXMwW$R>53o&+jw$S$ z5hA|}J~x1c?74aTL*mj-?r{@sodGqH0ow%?V}vClg6Dp%=|Rt&!E@d1!E+fL}K@JUEMp0Z2-#)$!IX+|r`9;#p!HRHo z0Er!|1ps=<|-m!tNT_8F1`ZBXhG_$X2IonMHi7@}J4Xss2Aje1iS^WFHv6wjdKM4cb@N zVOx8qmSM`N1}d?IlHxrDaX|Ym8HM4Zl}N>VX4{^D$NSixo*OdZznl|gz8dF zSj4QM3n#E0NmFi14GZy%CPEW3H?$c%yU=C=b9a+f;;~93-#6|?5`upasrvsUI0?!t zMw|07Za>Ug6XoeR;8E`b{qvuG+=k;OV%~jn*jc7a6z>iNOTs&v3f7`2dlw4@i>0V4 zt&i&scz9#gBjWm+wadxdk*G9g1?xoW7zkB~A##Eeh21PTFj$;eUbCqZ1w-7Bd($<3 zPBL-*Cg)^4+=a^)v8t+eh%;r-#}ZfR+4H$c7tg=(ggc+vK_V|Zhn5AbHmgnTGcA(> z(|<_tiOaJqu9?}%)7{nFJ2vHTUb+R@qIw9hGXw0bz9ot+y!81mf6BU8FygS*{9 z09@KkaP$bEQc_D+i`EOjMF`A};eF6CK~&%L{-tGnZYz^A+CnZBEab`t zt&jf`r^E~Z$+RobrA zby-p-g0d>BXef{z%xUvW97;UE%JG*D_x5pvNjCq0{r35VPXJA#ZKrlxJHz2TcMVjy zeyYtlloX+BDh`*pXas9?O$KWt1K6Dt1f(Dwkd12hv7UM5g{18#BxV|y3xwTA|eo<{Ev}bd>+|S8AKWCRB@5V@87AG3%MQbGB5Mc*%V^5+5}CSLQ)8MmlHVUmy0kL^k&f z3J(PuMXS9?z{JZ|{mEpL0zb(4hB4UPaf}Mi01m#XwGla)B3K@|&e0L@Y3sM#Fpg4R zCEGm;xz05J--zqC-*{~)*l32x{G?YgBNO=}j$1C)LSkCDu_iW(A$=JUU$kEAsgo0& zK9|>u2)hx{n4=+Bhp0f0sGegi%g}m?E!LvypJrjTs$-~iM6VIr!iM$pIQvIVBuPae zzD)u>QLJvE18~sc3`a(oz6)=9Z!+BpT|_pYBO#tWLD(Qb=u+t_nGhsEp zz=xS6)3r=O*jWf^FwR?(9Xmee12zB*PEaA_oFo#5*}q~fLhKPJxi0KHJGLJCPh8LK z*m?>d$;|uKCtUj!a4~6zvOgek9zUZ9VqK*XfEG|+_VGguu#{22XoASrustOdfR~?L z$t5H*3K$s>Be%*ha2xAa^{+wrx?^q>nA$0n$QYWjL== zfOsIDf#e7Eiz8Qm_QqQmr)3?fbQ`R9c$dGhL0h3t_t2rp3Gh|t`Z?s`hd9`>V| zszr$I0sDzlB?ibm$wo`U1Mu8CF*#H=4qYQY6v|Ab`Jc)0+Whec z$dF~*KpeDa`%zqjpS6g%H@0-Toz0T)9Sh*6r6M0jbzZu)e>yIe1-i@*Up zTI+?w<$lXRsrLRZ;@Q?a3yDSbY}`PVHd)FYI9rQvxK(JpsV_(eS-XajMALH4+2z%Z zb%FGq9Cdi~h#mJI`WKgmwc5|CwL1&&T$z z@o0#mb6b$`+=SAXH7%SHUQ2>;w2_W$t-fyCGS;MJror)AmYE1`)sft}=!I=WtBkBa zYTawPYy6uULFDX!1CvxX1OIG`1aS+x1L4WEm)S?=@j4wm{73#1$~6ZR2E6FDZWaX6$=Y-qwg71bJF zAG>6i7#oX#u;eJypFaQbB{J}jrN4aba5&!yh40Q~H|(KrGP8qiIrgm$)f1lyIT2Y4 zq7`$SPoMhifBXkp>sF8eYZ}yPY^ovbcTl}0B6OsSzIx?wmIGNn#GWO1LN;4c$qykb zemieFA%@B#j!@j1qXa8qZI734xV(m6VEAZ)gM*h#fMX!{p9#epn*RCvFSxd8S5d|h zj=UIh9#CY^B-m9~zj%|NB_l%Pz{X5;rJ+c#g+3J5Ki>Hz+wwE09-Q^u*3s9SA0zau zuA-h}0->DoodeuY4C3rX&g$C^+4$$$Q8@~MLDisjX8N0=W@G^1tso@>>=+_7-0{{H zB*Oy~=VL6fy08T0xbjL%N+4OQ;%l(a0pF?+h1nq5K7aEq|3y)~s7@v;q=lZpa_k*k z608hiz9r%E(9CsHx1<^MTDKx>Y3`%1*30UnsIcT*)wZGaH~)+Pk04wQJ746iGtV3t zDJl=Ww`25FDva09_Z@!au0@|V8-Lf1Dz&y*1@AH^HA>51U?j)|U@uU1O%*{uV`8Nh zjGizk99s7EGyTcVh+nEo%ra@1@zQ0pVg~3f%>mI`e|ndP|5SxYXTUMo=nbzRjV1t| z3>gn zp^|<0uM%PCBL|x$2Fkib0#$>AL6f7gB~=|s7WoCg5&81Wi4^OxbQJ2=!(VvnUY5ef z9Tyj254S(x;MZN8g7IYh&b~(*inA19YTXvfnz6bc`Q@zh1$Z)fA0?F}kk&w04I}Go zTZZZLMsEF&25`UgM#f!4RC zp{W&cg1FY5oObNkF$}9D1%w}I{akNeaE^ItKXcvV(m2540xA}G-{pNmHEHSop0M(n zuLSSqTRw)y8CFPw6mo^BmRL2uiR&M2f1wHtHgUFyA7uqrkZclvpqvG_D8fOK2u&y(#u|$FS=ln0{1FK zcfs9*;^ZoCWc+;_LVN+SNDwHIF_QRsKim*1jA&be)ptrPvWbUEkwxN zwTjT`m)yQZ*f;soPb!qLiO3<8@tqF~HqQ=gO)|88)ygY}bB}BpB9W~bl84|ZjfDLp zWI|lS^LNaBLWpc0af}6l#Nrs2lPL8O$Aaytg}!IiA(&-pT}HID0z`BBw{K*G_zY3sfuF`&8gWFc0Fqr{7#a_(zF@2>nhCqL8R1-61n>xOOsq$Q(>xdH=@*keyM$HIoyFV@WF_ zlQR=cT1ws%=Z{AbHENh^5qo8|6KSB-AJ++sG(;Qgz^}(HUpR(7>soLUJ;(lF9m9l} zGU!+6W*6W{Q{3q<&&)pSANnm@Z}=5|bTS^d)j0Z5nwF8PE)2*mHu;LOzXliPR~85a z)ZDTP5~zwp3ns1YORiP%!@$s0<91w1wO$YB9|nfD-?!)W-Tl#tUNE0Us{|~ z2&gSAz|lSrB4>qO`TB*sX?=VjXNNZPW0d9f`#PuOywLm)zI-6f$k8;*FN0*j-nK!N z~FFLd|nO`7pUV(eYFaEkpQ~6-z_C@llP+hnfs>R)xd{T?q}TIjLoV3R`)e8OyCu3 z_sUR-Y3F4qp7QmVR3qV32=i966cq8H{p#XrvOY)3qvL)u-tI#2X?|C_(_`Wj4Ez_5 z8NVQbHzs)(hoDntSg=#3(CL&(RCC#nG&Wm(2l!?lWQ=OReu6YBaJ?gj)HO#&)c#z* zV(U(>3nW7cMryt232Wjw1Q9l_$MuUJ-Srj;_KBnO+A@aRy5=$%4Rb0=%E=F441p9= z*IZota~M&MvM%1-fn|~6{Ga32?X4Y&e?&_87Dk-d=sVxon+B&W|4J87A>ceiOW*ps zj-totRYZzaF{UMc-}vUEKjds~Id8;wAf#^}1`HEg7eHO=@2n!dqPsv-px>aPtzRR4 zV}}K^qv{KD`TzBe#$)N^yYcHez@yeSARoVmNuG5^Yp_}300rSItCZ>LZksC-nBk}T z)6b<62@Ft+9>Sk;%O_7uw*mW_pzA6g&l=&KGp;FS^?@k_-GXW}L&t56A$sV!`z{i? z1;xxrz%W<)93y3KQIzsA8v$G_5YMfTECW-SrDZ`3>Sih#OV>Tekh)@vu^~=9GnO%a zx?gKH7L!$#f|DgPI~dKvf4uGVcN5k5ASz_Or?@PSH3zrHOqoM#;hu=W>QJj+cjXqs z3X>cQHU(+=G#z!d`j->F`fqC)Ptrp26|0f^U){`AafIDWh*X}gc#S=+vt;0I(3sSf zqV24C9{HwM2GY0O@CKD}%Mi#cC{#ce-?+Z$_6Y>QnX0M4 zHdS&MNb^06Autjv@l(Ha{WH=GN2kZQB27CwmuH}45ln!Unp3rtZ2TYp1S)^dz<~$^ zX8XT#Je;f@o9q8D0)XVQ(6e{m);;S~?f9UV$cX@)(u3F4P5f`vk)4%rYy(W2ygtCc0$0u zGT2tLn2DtDT#2$A+9=@RPv&hc)^v(yUGpm1OT@Wl}^7uvYv*@-ME@o$53%1a1s=k*Wg)Mp)~WdMO(zW45|Z{fp2 zh&}zJUi);`(^J!^1Xk&}p)I|v$??B6Xg&4lCGG&YJzwo3O9*; znq4&YT3=MajMiU37V0LkzmQ{t4W_?--%FypMjcS=Rsq)`s9wKys{ zkMwR8K=s+e*S3gji}@9#SckKZgRieyyW(74Hon=Cg{qy1aziSj#PZz7^;s|M+F?57 zYABoR!v~~OhOR~`4g^mhkR1?pr9ZTJ?eDou_7Ep=zB0#wcwh@q(Dz*a!b&kO&Imy0 z7M#h#fyu7?T5zHXcihdD>_q8~tkbpQJnx{er2GnEz?db^{g4O64qS)Bl6|xu^_IP` z9w#3=UQu10j2mE&wL=`8EO_K28LP%F*gt7UirUxgJd5kQw|;!R5ZY4x8Z(C%C2+`zuBoQlGnNLfx^Xzv$S{fazSc@g=_7uU@)DAEZ(sCRZ< zec5aLRbC`qRSs?+x^2}{5%Ndmp@3+4B}67TDX9G^H$Qp_c`)#x0@#YygEy|6`xraj zWCM3@ShbNOf1KZ6|MFVkB2spv7U6@Wg$GVsYJji$8Mywz!zj*}J!OcBUJKp=N^$W5A0+B9stq)rj zJqOPfi(^YCAj7|X^UK<)UcMS|7qzW+s<+wi)SdK5I%O_;Cu!qP2);DKhhr@$zXYy# z$r9$~A{?D6@u?s%z?MYgaN=kKOyk1SrD8 zim=3RMHn?c#d()$!P7qZkRqqG;rip2FDtLGzGj?5~lT_K_u5UYY4LCPVY6|+kyfdKJ#k4hN*v;LB(|9?+O zCKLUO_UxlDW~Mp)N}SX*^do3ntL-;*MtZp3x_aT& z1AyUicm>Y^YiI*f#)XSQ-jaEgmJUR&-lFL@e#DlIl8W-Y$UyPqTi-siGtIa#p&`W` z1A$4n$`9kN&MPf01I{w;=Gj-ia~(k+XOx&x$xCltcp=$T@Qe5ouWh()#is(V%qBUr zWnV2YZ)0mstu4pbBTw43(=E%4u{zV~VJhc{dc}MbC?Wr=onj?mP;e(INcx3(uG{+I z&9uWhFxFGC0U!P3d@U10QBk4#f;9l1P2E)EoIIGBYDm~r{FNU*3Q3e7R&N4NEXSoL zQGR4NYO2Z)t2z$lN2xhZ-yW+uIQ3+T(C?gz92(O6S*byC1eND&sIKFjGX#|(*&F2@ z=70MInTEQGY!bwcI^Pm6O?r3AmDE<(L@6aHs8<|g`k$nR#mIC-oKOUs!T}K1?|<-L z>%}FR2zB1N^qlJpyc^Lb7MfyLsmX+4i5$`zpqO#Us*hquajJv{-XRJLI86H$iF38X zim=MKXKe+J+57QtaDw-se?=@G_`EB=fGHOl68yW}JO0(q+p0TSD}mqSR9ik*Fgvj{ z6;eWMNBzKSE_8%At-yI6#Hr!9CFcV^C>FC0)_HuQgPh5?mKtO{b(quP?cDJ;j+TYs zf3g&CRFeumQu4Y!i4s3Jzi_;_zFJ0Fl)Z5G7iMIg}yD+WBpk(-B9tN+CNGmO~XNF0Bl+tSvUR!f75awt^vc&)GXn>iAGxMb_SBgqwLJ$LrbFWozKMTLkt3tCssz;Ui5Z%m)H zGn%z??D~R}zP63zSsN1MvD0O+OIM#@m#!>{iXazTu**{}t<%|MfZiVV*pL%ty$4+d z-zn`qMm0`?X6k$C;UccLePQKOKK;_>4=g^AOFYW=MdP1N4+CMk+5BGR3d{|FE>P!N z8(Q>RuUVMOtRc13Xj@|<*`0WvXv(z7!Q0^p-(OsS>x z+WQbYniNawL7D?-qQ?7a+OdU=aDH+|R~|)mRK*&KtD9wpVOF(vBFB1wvhpp8&LGG( znxN3T?tAjONi^il>@xy6DK~BQgf z3Ziq7HC0=$+h$94S36al0*%_h*vZ!DT}E7L!9G^w`oj=aAPAiYI>Tv@#brN%1;ec z*f_>DJUf>Fyg@HQGpTDu#VH2+6EF(XH-7du@o*`cA-|2@8Ue#kY*b{#5dGa3U*0aB zGl}|Wy%{ag)eOfpI6gGS0ghUZhYMzcW}c-+5S9a)_2EP78z80WUrnBdBHkt^ zL%;>;iP%4o9stSm%y_DK*IgKIVb*Pm!7Cmaf^^coD~imGL-)6>3i-;p%QN^Hvo-8C z&-Kr80by;#qCmxHBry1vdIIfe#ejj?vS9l2U(l$!6)@kz_2z(h6W2cpVPY0Cmd_kF z8z|LKSxm4-$Eo`M-5U4v76RE+n(#qIFR#B!$X6-TkQtYqVsl3nP@ur%3hF*!g zP<-W%gD3@8M;!{wVQ&esa?eK}yk>1Zdks1D3N1(SJ9YvmxEZx! ziCDSF_=RsMw-x_uIYduuCy)oVRQub=QxRqK-|y)oZ+zokdG+Q48uoipCDPJ_LzGBV znTa4*+D}BULv$DIw>xn|IwGqTtttdYWm!{G!=XwyKwvAR&1OtPf8*&-XR{zBvrd2-uWnS(G<9flt%=2>ef=IMvaYu=6zn4Kk)b`Q^?FNQn@0 z`u|%m`8ZwsiA8A@2M0?9g4zy!dLN9kA8Iuo&lJB9N-~h61~oShgk5N4^{C`~`k>sa zogmUcIb$P(L*Y9>iUo`>upz)MM*f4fZ{EZSJsHA!kdjnPHqiFch|G3o?};w$$x_Hs z6#ITJDe>!>Dp05oWc=QU*XVnoOA+N zK9VjHKZ^yN#`XVHrRS29?0fSCpr4c4Dj$|Ym>U2F_e4u< z9KTH(d==5mO55M_KoMYJyxc`I_-a6s5m^zP=G)}^3uRpD<)^}Kt8d!4=`_n;`#;)G zozLTlMM4~q`Z3Nic@!C>eEs_EGq2>ppv>$bH z5WcAXOi`grw#56BF9(@k#-(ZJ#2B{1+*x8fCf{xw@42Wi_G@N#aP2-HLwkZfcOb=J zyy*Xwj?Xp(eR@sbB+>RQTzVJC1Z75*pbR2FMOdgu49ew9aTCj&q5?$_L{LN)K~ND?5Wxl9WpOJCD!3tviu(I} zzvrC0%*>qx8a4X!FUZ_`&+rkg^6wP z?hbD+L+7dYCFNsKJJ@(4BSlf#O4Nno@}Q7vA~sIN78&3@;j25p|kV3MpFo06i+TqaQ}+KmvsjTKjql)ioyq{@@2{Y0TGs8KO@j^0m>do3<#hIO(6V!Rx@B)^HKEvU1xNVfc`$ zt0Awjf?=BuENP2SOu)pt#;UehONJe!!^bL`1mVSt&P1_&CQnF;XsWus^(-x&Qglx+@Nb#O+ ztld^ygqJR|DdS_mo44|72++}GlH0VF{%z89?G9A_(;qU(Tb@C#+bBe8%j@Gq>wf4m zX6C!;e89GB-1#;y-Hj^pqpg~6zD?NZns~MbSwB?1X}6V`;t0YpAbii`KtylYTiN)K(45-zJ1+sG#{aZbJSxK?GYTw`r9i z(os@vi#)X$KHoS&mr!eatu@;sLDvehgc%8>ZO|RoVpRJYEeH}oZPZ`$Z30Mpq$Pmb zYKO|Uc=xoQp)LBdzD*j5$6 zZxhS3lKcZ*Z@FO@wivEz1(=mK)z-$^ScmtvcoE09lTDm2tgp?li#JkC(O*!`rEO_E zwc?a|wJzC4=(76S=uld2avPy3o1XkDQo6JHp5t2UQty#M4fMX1)z_dwUF#8<)Lx{TQiFXcQ&5S2qZM^cwT;G}h0_P% znsmtj5gIT1juBn>88ttQ4jE)Dzj@~kR3xlJKG#0rDo^;d5hdJ=X>Z+m8r4k5r{V|M zM4YW*v#HLIeI!-ANPX-7!yj-?v?9z?S%`uvXiQ1P7^~^Gn6YKriyv`qGPx>4bgGf> z7^8>Z`KWwC3u0KwZ?c8x993`mpUx27X!u6dY2kp6VZK6fvQYxxs#+qF`>cG!V`UmPRA_fs&y2 zN4`waE>JYk`}pVWe20tf_-{0VvQh=X=tadvLGPy9CLBZMrm_PCfufvXu6NAJ1+RGc z1npb&Uqe1K2T=82z5yZ&C35184dv()9XFOe{x0n^tM4xla$~3|r3aBGPbD?b>NeI8 zLvK1`>!%;)F~-r^`~NHiwZWCoe1_;{?Y|@(>=z6Nu^a5Zi|7z2C@3D_o%j69$M}S3 zpBn@)uHOAm-?8Fw>&<9cQKTf86Y3WN2$sC_rRRkG%+xSkH5B>LKiZ1p(96rDBRW!sHWuuK%!0pEJntEf|wU2gV zAn=7fT4bR@U`0b!Jz=(SVD$5kNi^j9il;-GsJY(Y>ZbTmWBa7t%js!nzOp#;jH*gw zYH$3~KA)?Ul!%_XBuW&Fwx03=VsT^ozg`@Sm$Lf)#PvM2g%m7ReU-0EWnElVTWMVX z$$GgiuDA9_adeIBI1;U*p0p?_UePd&w-BXU^3_*6Kd0BT`kvuBV@^}Nv92c85HvqM zKQ>HOXX_=}*Ou4BjB)#(kdsm+Hk@|XIDi=+j4eg$|5jzp+1tO`!S*i&aZ(EzuKhBH}6?8 zjkcQUJ3;hptZOWg5Itg8a+vb4MTW__~Wup`!kQf>5sah0pik2hafvio!VsBdB?ZNSTpDBMv?u{*ENoYi|F&Je><*$`w5l@uaM8`tOXlx|A)apIV0y34_D5_)HQMYpH}qmzD#Gl?+~FWV=)(S*~^K1Ljs_?ry_n8V5g zNMO^;4gm$;|g8SDdmBN5Z3%hA?eAPIRx0 zUDjxeT{kALypmgwO7aHEYwp~3<(Sa@LUg*cyrCB5ERAWe++Z+RN?!r=u%!$fwt}q<+u%TW7qR*hs(?E4xE7P0}@2a z8_>L|5z1OqL(F*Q=|$Jc>&^V386Lur%!5D}17Cx56st6rY}~w0Uilxp0wh&q)x7`^eseJAi2T!Iti zyedx8R|7~ghBQWPd1^n6*g2oceG=9%kv~-!;J8&aO*JTk*$@Y&#%dcCMIZk$m_ARy z^!_YyyxXf$Eg#RFygr04+T}ALhj?5QtEp=k7Ofd%Oqz82&v`H=vq>z8iR16Uk}7cW z6+_h$K3H@MSP}`Q?#CaIUl6g6lX#H|$(h7r&c8u8hlq5?v(xWqVi^b*o_mh>vyE>Z^C<^ z8PblOZnTq?2NMO8NGUzGP)Fau9-_OF9yEq9{c|9NMOKdzM}n-TKKbkuL?73O`mCk2 zrjOU6!d--jnn%Dt6VUw+wG&6$E_z_dkcQY0x?nEUu{eo3{>JtCxsH2AhzP9IP?GTf zKc|{Uh%QaFkVq?rl3O5d%(&&sM&{OsPELFOQ3%_j4^2z5!6P22fB?!sCM`+h${|wg zxf!CnZE%;PJ2&a*PHf51eXsc1439Y61}WPyK-ukDqlA638^nzf+ee(tG_GY}IyB@W z?#DI(&3Qi*be6RcIL)qfPzk!BfGd>C#%Q@LU48%D@nuXanR`0865pRxMI$Bii-_)8 z#*Pk+l~*?oHP%hMf0?A_?q-IBC228Q7S{4X$T0_1V)V8JGa|e~W~yP)rMesnUU?&K zetn}c`_9{+B4VG__or!a&;f-4e2=Je`rOpnoaz(v<5F=HWCY4P0>7oT#G->6>S{?l~ljr@zf4NQ!bzOc>LPJdIYGp3N*4I^6RSYwpUbu>@)Mxc=`MAvf|1SKN zbS+mpxH@)O)u5_s6zq+v;n%Fa{`b7A<+pHZ>dVK z@#2bS=gI?dxAG)R(O-U=Pg02giVV>;N8)IJQPg*|Ff3Ikrz{LRM`<*mD~ZFv5y%b{ zsGMRlb{BHvFl%=145b*-Qk1ep`y#Rz-TUN3 zj}OzJdb!rEc8~jVjK|l5e(M(wM)GOuxnJ%sl&?V@3$wzt_uY4Hw?%!8U%Utmyor;sHh8`R_mSq$k@DheuOxjt|Mc9e=s#od72rVfLLTI-=<#MIzc|*Bpr#)HM^JandlzXpPDG`AL9|73vuj~<&EV& z)b<+;oj%r3k4_bh#*WQ=SAojDgeca76wXl@}oIn=zQT&fG*!?b7QgISAZ4-rNJlHb|p z)me0mvg^b@4*98tb(h2fm6f1qrk@(VqH_6*@zL^^w=sc`&fGqt6C?t1Y8yA*u!hk% zyX&igj1Tkl?+~{-LQ5mI{m~P*WD`WQyYL(8XJ55AS-ucelfaZ*gGD5}pC7q<%)^rJ zy9;76WJqlw7N^}f+|TfSG{pYO27DOmH;#Czhk3~Ci?AO0A0YV~-;-4Umzs8|hVqq( z-j(>(Wt|%yx@EFl=P9nYfd)-lTnoT?5bM9r19checNAh9rndky_FyzoxwO2xT1#%5 z$FAFBJKU2+W<4xH5aa==O|RX&RX*#^r)NEawWGx#ecuD@#gb%C)fS@}P-IAT-5{8* zn?sSkA4pSOI$7N@c?uM1-BWnX115wmYYv@&Nq-c_nnb(?uO(ysL-#*@h~o>1%pzFHD@*Dc8i|rSRT|B3>haVVvFK@9bO&~Fo2-TZL(hrFV64Va zeW-SDoi8GK)s_R#>cN%<*MR}n*MsN8jcLQLiL+YU*LCaWAm)Dx<=4I=MQ0k67x~tL z{Tmp4B?BjUPe1d2hVI&Lues-qS!?X|Z?V9e?+A6&(u$MP-2k@4Drm zoag_Q=zt(Txbb_6?$&o@kw6}Oh?he}(XvR;`^1xTI+LNWtO$SQdY|9>`5hhxHLaYb z6}i}KBK5pJ|L;W)bF1N4ydEyunD1vqtK&`8jmGrrmS;2I-5qh}=l)rl;9jz^6p0I= zX#FMUL>tN>G#Jb7oWi-%P@R!cUuXj64L&t zUm!MvCtWtSfd4|As*?Po3A7yE-@$coU)B)$u4|}_H5i*lj&H|D!De!H^)y~u*Kjdu z9}qQS#*Lq@4f6|Z>Hf9oteRTIjV1Hv^4TRh?{&EZhD_M*RCaG+L|tx?n=^o-F6@p}vfR7f4%UAY(22bOjvJsgXX$%Q!gN!D&+aJN zM}f{33ph>u7|uP3dI{4cV=XU6zpW6J^>`<8C3pu(ze&Of|J;tCd2(W_B82acq8H3< zwGi$gqhbNF4}09$K5Nxfsa5={Idru~1IE%w=xL?K@j(-}4G%+s4!qg+>FhB!hSChd zW9H&Y@R%IBDQZj&9TX}}6iE`DVfvP$aiDYv9xo2Vp;R_iKpP{UYkecfkRs0G<}H7w z`vrHG^+rRCWN7uq$S*$Q8%V4)K|zoPKNmL~lgRWpo++m5jsJ(}rH%;)4)dvwc5)as za*B(JWGBI>70!gae1z}@a&m$tunvM}Lx~IJc(4ED{S$nLiLUB_V&L2Ne6WbE7mi2> zR_szDL`$zOU1htftYRQcZ;Ywdk&9g292Nm2kXv+9?rSHGOS&n|y4%WJzGW~{;cJjx4Cv&!NWGXz3?ZUUNU7u>;U9#rBE5$KG?R# zMvh<@BuUA9JZ;H)v*cr@L@+(!-t%p)s)T$It!=6?ZXf%`ZSozaM<)m)PF?;g%i+Ao zOchm?4N?q>8`m#>|L05|QiL)wy~5%wer>!vcLyvyBt|mn0!_6Z+Qv0*-TDfgL-Za= zZT{;$&BQWw7oFv$h0r{A#?wtCL+2C}lMKCk{;l_r*wDQw7|e}C1Er;4>9Bcw?;kg7 zHruhu08QrRPv*bxg&n(dIQV-|41D_Kn9CzjK77(@?r`vLczj$hHZxd|XRDoIlOj4{rZSe4;?8sqBnBd}Z{dLmqb&pj^8Z)(7k6djDVLac3c%sD~ zadgrSZCBKHzUW!21Q_@T;fEzD8?O78pGU9^1)3ZTLy;U?Jf^aubZK9fR<%SFRg0q(8 zA|kMEm0m<3DWcUmF4SO{Z^+guqXM04ZxQFcroA}D{TQ80k}e&r^h1ovPp^_xk1a5^ zv&fXn^q-Qhc0qHzDFqHWCr`_v87I<3y8rtSz+)p2 z%)?0zqtnrfk}04aTyW!)mVTPzOl*@P>iAeqm13X(P=M6cq465$p z+#UCPtwgB))ebyWQcqJ!x^Uek>x_W)d61Jy$kbF( zT}9>(D88^J$e4e&Ovl6gRnvaoSyO()7=1 z9c9Gq3#B4){f?-uu6FdyWb`5{VH!SHcN#9~@tQ zmt$)Fx~OB~VUo`(A_Ppf(7lILA+++At5>tAnJ$qi)$#)M^+6s%x+ebzaY)s5O_kBX zO|>!(Y1SKiKcN#&mqU|k;2avJpBhC{)Dn>?2XAPqHAZaw>>M7pS&3gGJi~#94L8-w zP^V_}e~ny~vBBlA&+gAM?H`*VdM0e0BibFN32l0W`cYCGf}OE+AZMf@+9nUNI{gcyp%U*)dp12t zi6Y(1pJ1U3mwM;!nDd?oiCsOMzZV8dy!ZV3eE~D84?_mSm?YZog4`nc)t*gTSJPKs z^I51wKAF1p4TNpLgo!YwXkHF}4Tt(8;s$GwFT6Tw`7M+ubcB8o35NTJuuf%R@jmj= zr-yR@4}K4Z3xbh|ciXxzhRf_ni!8|C9mj=cfy%swZqgiQP1hZN=LtQ$n*AgrY`Rw9!_B_MP|r_Nitu*mNHYOPR#A1>O7=`OB2blM*(BhrCe@ z0rE|dh)!~nhJ+u@JdIS_cd?uNHtC`@>)vu~@Ox!Cc>onJQo&B~ZbVy=vnAey9MdS# zNo{?+bHO{zZk3-Hc}S*Pf#v0EwyfdEpAOnP+=ITh+0o(f+dk*kadbP{OMwc4Ny0nQ zdS)zrY$s*sXXX>>@!yRQN32enN1?i_Kv)OMEs5l4egzYt6%PCD*bk2ohtbxPpvX=- z2i&A7F%eR1FiZ&>f0Ou0s^g1G50}PUGcc^5=uw*>{Kbt06ISN2_U0b^lrV?uv=n<< zG4yMjcD6^Hny?fmzHz$hNwWeeRdA_7qIkw5>%oT(lk{c%2owy#!B_3$A&=JDT=k!G0*>yM`p1%97Ip<2xG2Edu_*c4=4 zr_Rta=6`6m1G=CsGN0HDq4#-A-<3W>d8k$vlkWm?L?Yfshrpv;5A2=tRaeH|gQVhz zw!(S6G35IIbrNkppaR8 zTYQ6MR8>#WBS}d1KaeTBYSIuz#0*B}sqc598@Y?)aTOdAH*UBON_6@pP0G=Y$3dwP z6yghr?x=K99w(CqhZ@C=2S;ryYHkSnBvc=!*rfE4%|8)GIRkjebzgN^v>H|lq#;co zbyGP&r1()kMEkI}%(Z;gT@h_icV(QW+Mb-3?51Tatwd zZFX|%^lTAGrPH(B9kvLK6PAC&cy`LQ7c<{vGXdNI`W-|>8CNZOV-P=NYXPLM+A3)0 zRMKX`x`$*07@G@Vqd@R&Qw--$m2zI&KZQ5fK_>f>nhlDtis4MSXWT})b5{A?bZ}Dj z{lk#Sf)kL?WS#j~(c2=wp_2aRBA+J*+ND;P!MlSOlBSDbyNz?d@KU~lRB!Ra1AA_` z!s9zp9BnIL0+lvlkU1aEp6u~oE@_^kk=o7dvBWj@bN_N zL%AjWyqn)gh7TTv!nuV3@3mLn*@ylrpeGzwB6W;3O*TVqcAI#FsWtxJJe)*&`Du^Cit4$|iD=i0;YWP*R17oS@#4u5k61 z3CXd;tSgd3AE3MzZm9b|*flynr~s{FIclR~`3 zr|VDW$3#i}2;*)gD&a@fEezF|5TQ(w4-}z{a0*JI>>u=A`Q}wOa4sM6@#HV>-1sSs zd~|=4F(vy*aYQsVa%7YClL{ZQPZlTY2kFj<2S|15JU|N$IyE686M{a$M2bRD*L)r< z+&fOj5C5LFHk3d(s%xkzM_Dc<Qfw2iyyHJcJZalDl zNfUORm8Q;|rbcpp^;bVNfHV&{+#zX1r{9atx|Wi0&x5PRl0cHx*FEppIkm23mX0R4 z&~%ov(g!i<7;>lg;b1}=2x~Q9lehpq)O)v(-pL12M%wbrY`%th^YGLVAr9yykZd|6 zf=1OQjAsvAEeRU&0RMR)GxW1F5h9XP%$^SJEEwErWNgK{n^0Yi{k;8m8XXnj*deO(-AH~i%Xo|FNr2tPy8RNbY~LCjE7S0GoG7^2cx2LRSIBKLPXiN`!&TRnSAs-UgMcA;-&l6zn!oVM7?aNw$H}*9;J&Pi zk}y_Pi&9%PF)hCt2bPZgF@L~#O~pOs7pPTqajY>~Q$-oLH1f!IXQ)z^%mhypN2wPZ zs?fj{b&cxkh9K`lYM93Uubxv@bM{2yx~aG06~=}S)-94-VHM-YqPKizUstpVi$y&L zuBqmPXAh#%jiU^V70yz4-2eyrZ=dh>fLY_$N%k0 zD33Rf2@`(AOQ@fTXwhBMpWDtJ)WjFE3yO2j#|wA9Jp4+J|Nlf!IXP$vrIJNBn*}QB z@fKrOvm-D)O1WjxNLeOv`CSj?%SkLzP|U0XlDVT&jIt9p$y?tf^c$Nx`t;YyhO6>9F6>dKeEwu69; z!caI|%mnL4bfFV}HJ7q)^O)0cu*omz1+193^jVL80#p+QQi%17pUro3@$6}IK_mR{7>IZyTQ7a(GvZYNxJU{5_0PYI4XoQF?j zk;jf#1p@lktt<@h<@l|;RNvE!=VCoYG={zQBB~Y+oU1VZI)b$u~ z80p;RPv+d0FTC<$%9KrbtY=;S-lB`)eUp3*EQPN=izumXA^3@8$^8Pbq+(hcw=A1) zKmTM-`|v%_ozIJMJk_&~{&+a{`WMI$1pEGIw+Pb*WF8>xQHeXXv*8~>GU#dh!JKaI zqtE{%@tK}%`IwO>nP`LN6{*mse@T%<8~n!{bo!Qgg;EeGGSTL>o1X*On!&P2w0Cw;dM6Fn?Evo11dg!&^I$u08kdGrRP0NH*lL;aRF zUc`^=K`$rdP1FI|a;2UmXnitomp@9<^Eh8XerBq6(l(~vr$APz&1F;Wu6#9Ff3tmK zSJ~L+CBJbhY1w{pyc*0^FSBhaQ4?chkQ^7)fs%DEj?h!j;}u*MS^kwuzv5cR>aks= zvMoOD(4siHL4IIUoNRMKSK@FVrNsE(%`l@=N~CFsJ^g0+1DGTzV!zpZieDrd{9BM0 zuWVtM!|6cRioI*16f5>FMk3bdTRD1;G=H|>5G<06LI;<0oSG+tRYVH+7V z1lfnxD5*eB;2NqlgI*Jr#PJ+|L(e&ORD!5-?4#OwXx>c$+8B~n7K3_XU zD)4MdfoXSR>mR(Rbepgqw#yg?R<7ro>?$Z|h%mB;)MsPT z63iLVQ{CLq8-_JCDH6)q%>L*pvq^cg3dJqS&agDgJG&5m>0+y=zZ*|PfjBb zBgkJ-E=a5Qf$3N8^gyBUVIt z=xp2hG3xv!7;r)NvJ~uj{f?#H?N==a<=!@_uhMlm2EjGewnd*_-RZE z2*Anb#x>UIk=s!*&7>ES4u^ey_T%tho`H%i(&rY3ok58Qx^huVoJ&d8MMjU1Kt7@> zdLcy)W8u}iQ68Ucx-GcF@*5L{*xs)OG&aAwl{<7u6moNHkT;Xfk@6ln*1~YGkLiEj zO8$xG#TtWy2NUjF6`c@>r7E|?g;yI5RjORvcxb}`1kF)QMVV`Kh=y|7(UaztbvaQ$ zFH=tnlhe9gBjjv-TxZi(1OKdc;@AJt)F`5d0$eD0H%!*|*)@6sWnHWI!PKXZh*fYY zm=GI>8MF7!e3p*AgFMXNhz<=+RDSuB3HyG^Ap1$Pn~*>V<1?thB0iKnlx)#{_ufr! zOPZwp3XK#9vGQNaI7~zvH@`hQ=^Yh;RI~t`@%eDMP?_+7-pP;5??YuWwYquD<4d@X zX2;0DNNKRpyYTS`CMzk$j1=%rS#{&*vQ)SoN|q6yy;TYp(pzONpI@Q{`+sAm!2-{y zHdVqsOoB2;GieO>|F89VSv?Xz5X+hX_EPQ=iMDmu_rOqvXyNhS^bu>5gk=4l{qZ%v#1Cho6eseUb#h zrg}stYF|xsC`hcadBj96lA9@$eGqwDL!E?B^#%S#NrW#cuQoo|bcafNV>3N0{`S`t zm|lMLW9}W3DP7WlrTwK#5uH(YsWI)I_sH^{uJW3B9EH|W2JqKhm^axc#1?yOtrmx1 z7OFI+>=<{mykKm#cae?QO5aa(<8}s+8ybn-$Bj`FuKy=5^JLc>9-#&Z5%qy=tpcDs z(}FlzC`I)Gw$|fqr%#UT^yn_t)3$GB`ZxinqFsoBsi-u-Rd<=|ql*dz3FP*`qFjVh z1Yq;8?|SWBu7Znd!Ln4bcik&b{oxP(xgOEOHiN`crxs=(UzRMw=m`=7OuEM=zvrl9 z@ci9x_%ZO2g`vDKW&2RQW7x%t$m*O2p`ye)@`EWMsM=oG`>9khM3`tv0n7&8=?{;p zL1EUfyUC2nfSosDjT8jNvu$Y7M7UxMAHlo zv`@$%r((uV)aGwFn}`z8Da-)1B8VKbEB5|&NYXNCS#zxukPwYJsP@J(X{sQl9`!qz zGxR_1IYTIqfx|T0%cY49*3f9(L?Kkp>}?%iA}fONi(8@*!XTD*_?P3QaKnCRdIn#s ze0KSQ`CrOs%$Y!`SdTKR8xluCQDgUVg~$SA=aMZH(EIu9t5E9*E%A!`_47XUdV60d zkpXY~D?L#bsT)~oqLG{cOu|&?dEMS!`Hafw93s~w|I#aDjHNaCZ$+7QbIUHVcjqMG zX_|tC`eeRW(RcIhh+(7tlCS#moqWHt39WIE)Nczy@(3AAXIlJWlkuA5GFHX zU?z*nc3g4entf|#$UVAudDE3sF%S}JxLqDqB$Zo+j~`u-q7Z%I538xE!rn=ef8m~rOQ@*oFRShrp2f5NC&lU%8mwV zXX^{r@#4uSv& z$;!Cu)>##dP-z4!{vum`AY-Cfc;j)9!Zl^#9@X)aBTG_B-fTb5E)>#V-+wRg+ZcecAH+f4ie-sk$JViS2- z-*Y%~a!Sgg#R!JTDK0DwnTgzpd^s+~6NdnH?MJirv#AHNVm6BJduQIYyFW!fArD)& zlkhiw?J`!11`krcO1g?{+f8wmEOCdz%1mUGagrcZy0K)O)4!bvr{p1pJNEimqzxt@ z2vew3CroW~k2JXqS)1q&Gs6v8gop&IB9e*XvAjT;xiJ5!g}(!0sIH@w9-i_&|5?z2 zHQ$Nnf^0R$920m&2O2eQESfW>FWpuD0xAMvenNbYKS+_-g{Zg$AMZZ$6C*&D%{+ zb)33?E!9r6A+fXeNeaeWlEiq^l)!Qw_&aDI`IEbW1a&a%1`>BU+z#p1wUJQMWc%nY zHiLs{nrt8LdnGj?^zAtN=J@|k!cF_d1&(AUyuzoknG*9mT7kN9)C(Et^KzPbWj|oLN z(U>ZR**7ZflP&I2yrLa)o)n5S%Sj57ILR+v-BPIs{SI=Gi`=;gI^Nj1h`ZHA1H(op zTA>`*%nYTr;Cj1okDn%;n7aX0FY$ef3-LFGzV))W&(Vth{tyqW0?j5s3o|!vNnm!L!;DI;|u}1VS&<+hCK!vgW$?GXKuPb*W zVD4ZppDRu11VYmIv$#GcU0q1M z=&33tBZFA}Mh&8Nj(=I{`mJO&lBg=(V~ghQJeP5i(dcKQ1GkGc#>}21-4yO^Qn}Bp z>~jG}fNyAHBPt_P=BsI>cXk}ifQNGqr7XP#kWhvDW*>;I;g4oVq7VH*@9;cf`!?2wdTq- zl*F6PS{16r0uh81&&E*r1Jjy^rCXbt@jy;Flx4#s6EeqXXC7G=828m$6Ib-2lU}lC zQcvCuhXkQPz4Zh=Q@;@@J@2aff^z?vq$gSSRP2-KLE3 z6W20h$js;D+$%idOfU@!ajrpsDGf&)rUY2jT8sY4*sLlqh3-IAeK#?6+IrQ(dJ{bNn+RGQtGV&&cmd##fuBvP)>!tWiVqN5F=gI|40r+d%J+DDc5Ojy+sBGKMw(GAsHnDb~p1$DOKM|*z zsED#6X|FW<=vXl_**%%~tZnIg#y&dhXS!O<4)twvl@hZ1inB0ly< z%(1>#QqqlZYMMK<9RO)^by`x28@m^NB`K?WSc^GIYnj=$bQIp=rbZCZ2GoF+2|vD| z@C_=D$D-Ut5bB+jv_`-1)XCr!=?K3m)3cz55N8UwL3b2NrI4}}s$MMFbT9GT4zj{9 zYKquj(ycECmseGz2$AvG^0AM~w^`RXO&l%zty1`i{W~Vxabxu}n<%HLLq1D`=Zce3 zznwVCmRH8!FK1!DAr(yHrld4Wyh+xYgghHF?tkx#+$H{SL}XP$xu#-E7Z_7$KwOD%lFHPNBSUqTke%q<*Trb?Ir zn2whlR0H-)>Z(x*+IZrf8?ThxWV7I@;z-Ba@y5#7B~c_LH`Xu?1wfoas z4{&+q{Nl2(cgI#FG9yT}FmR#wk*C{pv+Yn33V3+0U%K+w{-J3zayl0j7nfwC&VqN` zq<7}A0EqDWAl0^e_>1KiQEp!;%DqGo$K}2IiqBu*b{Uk<<5|t*EP}BuS`@Rn>!xJy$K`GOFp?-XzqR zK%HPn))du8=}lHVWHWX&Hp{r$(U?*KH)P*oW7NiHSus`dhIyhRnot8VjQuy< zR^KyRm5{{s@|O~e9Lg<|L*SKDi&P;GK3P#JW)B&CWX40(8Y-*ruUk5|gnXRgPOko*pE?vg|3(+yi zP17Ohc&#*78DxlyhB^lQ0tM(eKkA_!$5FUpX}B!ty=LolS-0GQcrDd+C|N<`1Y^C# z02UjLT4*T{p(OjDd9l-F=0Tpr>wu$iQ+@1kHuVcMWJ8c8{3IjPPCa>iQ^;g&W_jo3lVghFsF;&^vk3x;9ey@ zVZ`s1_VkHIoRF};RIC7P8IuF@v-;+@lx(CLQ=9yV4fvuW3uQ4B>5Cg{pPjQ#s%!53 zo?5VMS<8hd=nk>09Ep=R?Rt@~1`1Q1*@6)qi)>wF{agH-xze!)9U_br zc{s^9ff_R23tv3_G0Aw!$(N5>n&v|@fyemx{jaF0Kvv%qTyKjtQFgmm0~x55)d^Id z8j~A0-LQsIH!`!k;=zY``ggK~Yi$Wu=#3*@vhtWj#TkE54Pz1q~$jp3g?x7W7jT+u^6vKG7N?pMiSmd>W8r}#P! zVnhZJJs_J?57oN?vLW0~DX3AZ+hKe;XS;0tX&r>~4Qp=;S8w7lfwTo*oD;WrkH?9Q z2@b;SE=)kw&u+9Q)nUHr5yvwS@~Z1lRN1+rwhxMfK-*Cn;uPCXOSoABrAm=it+Iss z?wFLO1q7bzX{(M8m3kD&{?xw5*tKm@xpiUxERJ`1(ZZK2_P=;I--R^Rh*T>+=-c}Y z0$>>ovSU-u&{)OA`kWE#B3nL1E9htAjrp@D*)H+<;xPMTYw@=~JexuVvihFr%0X?j zwHVJ2;&4}>CI#;*R0CI~-Ve&WSJB_b)~DY-(>jmeif;U~wSf;G`SNZ_Hr*p8c;v5R z?UNC_B-gGY7Pyp5VR4Edw{g7NStdpS*5F6~d^xYX}in;koL z)j#;O+^Y*{soK7h*4TRUl23y&+E-QjuR$F>2V7J@n?BwCqPMwKxOKViinYt(bDvaQ z6x@Rh^fuMN@mAR)ER#)Kh)A|fowZ`6D%iz#%VtGC3jpjuwhiUKB}4cXK&;ZqvS(tA zEluteaRl4G;aZ?V`cbQ4k@3;kPwdiCxj5eCO$&~n&c215O6i(Wuz6q2W-X`1z-&!+ z_8f`{CxJ*K461qAw`*MU*wq(XRH0BDW`AlyV8+bHACSbsJqf@Lf);Q5An4n;46-6Z zR#7^j1!lcD7|oS-Za;9{O--(8fH*4o9c!aEz5jS6AGLc;grw&cSe~2>{HY$5ALGWmYhLY3m?)iLEf78q6`I<2Vk0YtMWM)d!f`;nss!aMi5%_p zkO9%cNiD0l34NvoFg%Fsx0>4b+P11MU5eg@@?^8EewVs>gz?q(X}{#_)okCk7GJ7^ z*uq?tLO1e=!L@$tf&XwNbpU$I$O%%D^pnfQja`I!f9e@9;Z7Ms3W41zxx$1ght}&cy*9<28K%$~~Vrh;effM;* zxq(vz7$%kYKqZRbpo+_(Xz}P$rF8Rha}=$`|Lc>-&az0tAkoL|O$(o|ePOZmwY#@& zOTA`^wFd!%e`#evj`uw=WHgJz2LT}%e2!);k@#rY@b%qmJI;bb-8Q>hDGk-#VK7=- z7bFy%_H7M`wrf~FRLG>_ho5szKSJ7hb-I}mL^JS?|x^pg#AuSb-+JGId zH6a9B+#mkShCWKO{jRBetqGDPPQt3~4^Hj3HN>_wEDyO*-A#*ztoUn8xN^eveR}EoNE{#9bxh;7+(^@zaWVIx#!CsHj&E#E+#H+tqh=J+Hw6rF7U0U8SB-WUZq|10oL)~S=G%Wyy~ORM1PMHk(o`!!Qr1vi zSYH240m4Af(S~a1tM$g!lSeGHp+G=*)e~#auU)sigfGf*uAEFRKjlVIX;J!_b?ojp zi|`;3+61Mse$<>#&bJO6BqHGjYv&uT-h5(nB*M9^Rv;1EJ;En>4fnwXTj%p03iQvf#s3mBgtr-)z=*%s2L7&{U~B1kr;g75y#5?A*kR`S?ERLn8D6C z5sp!?);Q{wmDEc&tFOEGl`uC}BTp|?xVJ1p>K0nSibztsj|R(`H#I|?WbXMtlpemN zt+#+UyRhnJq4Q9N_=yP}Ne{obFgjEjtXUw!4yQC6AhMD!l()x8anqo83(mON^*1Y% zL3K)!$*^SW>OQ=3BzH?mcXyqF870uPfbyc2SXZP(RZ*XuXkBgfFyo%jUWtQBbmp8Y zXG#NQbKCqx9MhH1CaHr@S=ou`~(m zQn57uk*fH(c3GOb)j^1Y>2~|==zw=;sIYaJGH_{KgBf^-hLV*HXja9!<`5hyOrfr} zGHz_yvYsKYq^}m7@}c59u~)dggq7uCygPS?Jz9vAV>1QB!tn>UOz6dOrhE9jwPA_d zRBboqeiJ3-H?*-pYLryY>tOZeba>E5^iZlU7a)_`@aIbxbB{lH!OKMNq*tuHKmGPQ zs;#5DCpcm0DR1`<=RV0W@b&DI>$k{#zOm|QN_$X2<)!96tyipl-oEhPS$xLLZPQ$N z%55SBL3(5)Oz7o60> z;PR$wRM2UPH`djtf?+To)KeJ*ZC#i*?p0YTqpz#AB!|BbQoS))5BO^-qRRlNV$n;_ z#F}>$RTRo$G9bL{~UaDiI=~c6a+N_bOuI&ShyTI8E@C znnZzA8r7pyc?W^BByP3*Wbl9Xw_-a^T0KT7${lTD$~fE47HDL?XZ*E` zX$*zTzZYHX;4$u;c_Ww4PNz@0ATgIKNe3gdt+L(_=g8|5qaw%lrTF(|AW%Os90_tq z7TQrD+#Q{BQ3Phk=Did}p~4}P3LLPgk}tX=*@EUlWd*857Bl9*t|~gD@n;~I+n3*n2r}}eW=V_)^8>(>xN=ga_qPMko>Bil2saHw@mgh zqT3*4qBUQa1bA>w0=Y5&?G&pSYd}I%jjg+ij>OSoHL9@a*dJr^ye(9SM~Me55Iobd zt%Hbq_uomblBA`Y!GwCP5LKvJ!@=B75#F*jt+q`9AL^P=d&qeH z-n(RDS@)V8<|5o107D#F+f_DoKUd=zw~=Rpm9&x=U+gmBxK{ z?|z=1b(Rbnvqg=kv^PbT1$nySKeb7%r#=2$iTo!=fvvEtrFDo%-J3 zgBz2R7x29~=I=#kvr6c~kMB8^hx?hUG?%bMT_Th>-FuJ_HV`=a+2lCud7RV23C!te zTq@|%yGD4E;NqAm-#L?eEp2mbW)J3H$`~K2*V83|>}#CvOwrW=QZSHq7srMfeAQ51 z%2vuglh#KR^eA)b&W#YrP{%5Z;>94KQJ*;Dz8z0)w_RIYW@oQfX1By6C7qnQX^kvn zOW6X{*G^Dm9mO9u#$fI}%&O-TC@U?N3@j*%`VrW-9oX0pSqJZ9P9_N0=F= zZL>^XXnT@5@{arnr99pRUgp6!1GK0RRrS=HkI0X)?SpMf-pW2$oHi#6)uTxujm8A? zYld?Ym?);u+K~SeacXk_GS`bTIGr>gK3e|rHXCXoU7{MT1RKy0e&L$o16agkw+@xp zSKlzDS8w@eQmT1F?2@Y3rL5DL>5v!+Rt#qW22PGoE=MIf^4I3v^}j7dCm3sJE$CJ5 zt*EYRs*IL5)Sxa}BMM6zciwyr+mobfd%iH-YBU>b4{VeYh*iF;j9+*S&z= zge;wzs%AD9H7gZ|HBn*XD5Qou)Fh{7ENo_YXz?~xD8julNEv+zxd9&*sPAMwG?d`D zq$XNf8`pMpWAWTEM>DE(T{N88W%acbc|#bZ`llOfp4i7#MDnS2xc~n|w;V#F0AW!n zkO<{odRufgr=YkjHyQ{R7KfvyAyCvGL4oR(6NrM42E!%cP$U=)6cv>P3cTC)y*m^S zdpaMM1P106d!Lyz^F@!(C$jL6h;MEnoa_B^o_9#j(~Ra)bQ> zWd)_tqG0KO;_&%;A%}}@{X!Q8bFC5A|LcnDxfWGPI9M1eEA%d3x@Hw?O6H^wOuu@k z$9JmeqkrLcwc${1FcM7|?V-^VUiSDWdPJB0HMzCah?0C2pw5Q1wEl(B+@eS{5-eps z>_;f**e$Q1I6F`P?!v3~Ua@t{Z1O+?s*#dlPN*N$uV}(|H{Un12Re&)y{Ndz_T`md zytI&@Cgjh|e0HvUc)!PACA=5b*D6v#Y_};6f^f98t_w@R@xsNwhcZauDJ_fO|TYvbLn{v1eYtY_j^Nyl`C6+j(hty~+2)|2L?y^5(=L%9IbPjsfIhrNU{|5Y4{n zQ;;4hu`HkT#BXr{(^a;yjS{M4O3ii+`!N1tBqi{zh3NgwPL29ZN9eipVvV-d#*?d^ zX^(F$lnrF`fWS4@p;VADdF7R4msNFDe=RaKfa1oS1B;88p1K?OY;%SxS&ZUh?bHN0 zVIqG4iJuZsRNW0<=2N|1eLP6Ru4@=lUR(7yNp6>HnPeruGT7~p{V!345;YvIyOS{L zF`H$)-!@H6d1d{(JP28__LfX@_5P5UV85QmGb^{+DqH!l^@uDxrS2^bx5&=7L818= z?JM@*kO}W6S1?IT*8&;tF=$vFiJSFRQEe8OwB)fu##Tn>W+WX}QCtNRmV?mKmzXk! zHybxW!Zq%h{BZ+M!xnotJ0uG}$t7PAO@mcil^u-@Pwb$^E13r`+dxpMudI*8D^L>M z*u3G(Po>1gg34da9JRzkGjU_wsw+@-mrMw`?y5#gu&2x$a}$`jBMR!<#fO%|;6mj*>t{v`l|lY=!3ZRqbvl?9#|YIi3UnSQK*LzS!=nI z$moBzcj{q2`cGf)w8Q-6u-jMGb5m?*In0vWl4vBSxP+8Ul)#jn-h1nN@4Z6~?VgJB zL%xZIgLxPoV$s9*JUfMClFsHYGj zkEl>|4^oZ?(z^8~ydNxj>sZ{sBg3SbLu@3u2_>k{FDr@m3xo>r@xuE?jb|%1W((y8 zO7YXXOV%Hk-AnkQNw?Nb%t-9{MNNHE+{PsHwvsHUMVRBFS^URr7D82b%^SqVLre0Y z?;V(HH;q3)kyj~ih)ZeGKvHSagH85K=GjcZ5T%vCN-dtvG|WYtVbXPIwH1l5B^5zV z!P64}YHx@4vInuNDdCrz!jO}pKH5+YcaJgW)hR)X$ftJnq)_!uw@m|Q8XF%yaZ9#E z#8Z$V-X?`7>zNsW%!o;;s{}*X}>#OT?$_?p0U*L) zp@UTD>n!tbx2q|q`M@M5mDh}Xm_Xc|GkgaN$q#ieBpvY!;6~h*wBHCN>%D9Q>Hcvis);GZ~om@0ctXB%I#fJ10oQXIzT6H?O*ZjlrQJ^~*aqemdOK0wSMuGD&vHWVM0aS|-4m zUOUM&iG7m&+sW`6ik?Y@WOh>ED?`mFe#s`PNSOvckQ+wMzd`Eh2YXu&O|U1c3A@r% z?@Irhr-%;HCxWVT)m1fBjmCXb#-9yz^GMGW^;1F<;;IVc?sujjEWxxC;(dzYXfT$% z@su>wu_%h4*_vz2{QM?rTj60xlK(lx{&j?#3Il=A*t)wE21~=C9M;i01^PyFN?`t8 z@#U2vNL<|m{rZszFff`IE-ovHcsI^_`lr60B8xo8k(@vQbW`uPSGT-M+HH4gj}(M9 zpIwH3OC#Qwui6xVcI(x@M}p!0p`2jE``E+l(L)mgM^4{dIp4moZvT*d5jkoB_q}s3 z8v;7z{8YZNW!lwqJTx_QbTnBigi8f8ynrs;q(I9bp#w+t4xXPi=V*%9vYwce?SK85 zD-*ub)4q7^3x9Err|17<^?Z^+yV=GgKs~u&**I!!YFj~2ZDGrSF)KJ|%=)AN+b@a$ z0?%!HXub!XiI28DD+WBHkqFr@O7XwEZ10%eS5ET4reYhsP=RB_>nHedpvPI?7sBum z9vCeyDGe2dE&?R@AYa~g(_6GY8yt%I2IRB5=a281_(**=e%0t-J9ky2c6ICAw{G$z zOkLDJlp6{}181LgR`k5H^0K3O1e!TBmTqUuh_y!hi~P>yFK%4I?w+J~@@X)BXWF%s z{qWZune@u}=czYlFM~ztIAJ8cQE-kN;)`b{WRg=U>4g$=mf2s;`YC2f9-~B!G2*U$ zK)_V9l&Uwb81qs#hDe^Jzd6hNC0(6JS*j1??MLRpoZ~>)Qhhrfeeu?12?%?U!hs_l^D^4HOh8vs%QvV8S}Sq1|#rk@F)Ke$ANj*zJ7lG|E2k;@fQY z>SHP@hyn@Z0htnX72M$m_vZOd6DOK)YHM~ucJj+NEqGut`4Ro*+iY9r7^q)&B6#L5~U!2n>vP@49c_2oD8k_Cv3o0oY{3`^=l`F*x>}w8qIJZ%4PC zGsP*&)MyT=ca=n$UR!W~k?$<`50a)>uzTt>kMC@8YT^{w;DrOD07lXr^IqBmH!BcY zeIjj@xbcD9+;A{L<6ioqDZcYas>K5ZPR~a zZQb=RnhmXbY%6;39V?D-K8Q;AfG6EOYwcM?+RW#rL0EQyL=o?M%lBMNYhj?m{96RC zZ^V1WxG&dwd_NW^*nf@&N=pMd`OIr5BuZT<@AJ>!THyOhns+4yFU$sD_O5(s1Cb3Z z6}rEg&x9vlnE%1(F-)P&Q?~G6_*-}V3CQ(h^HI`yCL!eIZ(Z?Ex$`JCjJT}`LY5=> z#n|KY={MxlJ%MSuj3NPSPPs5lM7$FwZthOjX!WHY()Pxr z$M4+6mFStq!S`jq5G!EE3Q3aYCPcF;dWE;R5`CYXDkpVEg0 zhua9GsWg;L20#*<9vlDfOG(VIKd>$pNrjUZ{)6YReW{k1Ac2j2dquwQ1f=%4yvb*F z-L$ukCrLELOO^~a<*qlb^Q0Y(flE5%Ft#P7ZL{WD!=vkrg8zxLju zy>BLP^r4b0WuDR1Q`bz^-nXPTl~{KF#AhETm*24|mIc%?$C~&0rpsJbud!wI?&Vc3 zBiS)$!G8EhQ^VatqB&1*uSp!Mw4^LrfDl=PLy@Kw?f)~f>qbc2CQqcfL-W0o;@k)+ z74+sK6W0DL@rdX}>z#AFS0DHY+~_yr+>%I6Gz9tth7>6)1ZzuVBusXIwYgu$2<| zjxw0rUs*PB?-wjqXn%0ju6f=+ZFo0gkLJVX1-$LMM`rkbCQeWOL~Svp$hPP0IS;ea zbG-STDOs>)Y)Ky1t=iiIa`8#F7nRLFl`MGOyKe*>J1}ADD(cu!7X5)z)BFAXGYp_p?729Wq+|6;+; zIg6MOC4Q0c=$Mc>YUCv0H^09rk$JfvMHH9iD%Y|JY^uD?1 z9ZUjEL`y>v@3n8faw~(^p~Y`rcx@qZ%Sfakin~;bn8qBIL>G=+hR^{>*!0AN`NJQr z{*>7c1vl``(OSU=3!Xj=!pY(4fr`#BrMM5qK7_-7SgM|zmw}y4O4^H}Nj1sZH@r6e zH8!V2%CZ&aLt{U%cRdSBrdGQ1wJ-Ox$YtuHkL=suhZu8dAe;x@mtR_1f&+rGL&DF7 zjn5Ay(aQGFe0J-;TZ#w_>Y2Vjkkz+52eu6`s3#@G#n9@mnlk1#7K_!d3?ntoJ3IEB zPcp80RGL#_&a(Pnd;8l~;Lsg!zwh5C5U)3>r$uGIxcu(tna-HcEUNi4@49D3cZ9sr zJ&~Gj7(Ht+iJxWR0uTVm@}r-66eoHHB)a~Aa40}Loq_L8;AVb2?KgBG9SdDK?n^I; zYV>1i88j5YWBBG*&L+51=&43WfSqDiq2P~Rd^-1sVEZ9kNTtb;e`F&e|Bvm0{#V-|`X}FqLI9+2F~Rdt?yu>ru{~zV@p3xyy@6p@pMeZcRR2Ic3Ge(j>}u z`{P8n26R8?N*x>|V65J816RAvWZQl3vqksBMK+hU6BAv-a!eJ1$dT>~2;Vsc!9bA}!t~&M&@1n( zBtqWH_D1Qzk|1fRx!xOQ{|gp51Zk03D;j~(Gg?4Y3BmXIfg-6j^3UEWBPQQX3hv>- z3!%n`NTCO_utpkp&6*eZ`kOS9g5KbqFCxG9!w+tWkT!%^^a2E<2MWr9W*mHxcj2;| zpxr_=4i(X5#2(J4(6fRFggCt|@3@ynKI-wEBTfqyaky60ZV4gTE1Em7C{PG;KOhv$ z%coHavb|4Ey&rlx0L0s(@d}Cu(&Ejf-L`W*40aH?3qp}nUK9q-jb2a&6EZZAoFKro z_U0GbA)+tW`{d&bVMrz!IQ3h|SJU$8L%XIo626!((kNk&P&&s&PrVOY0Qd&| zm;MCeFT=UVM-AWi%PiP~Yh>r8QfBE7P5~j&&Qy3sLrKmt?oKc)# zG3NJfcy|lY9IIrt_6$~+63U;eAWJc63UYgG6&d))vK3?&Cj@UDy}6M zR9O*1R&w%rze^uj(2*T?L}A#&rHF(d<)S);%P-{=M-XV_2R9<$8}&6Bhasl+-t{AI zv=Jj2%X+qKbQo`{F&?;n|745A;2=`xJDw-HB3W7vT#9jl1-8r+s5zwpn36ymKtAB> z$`tJ&J$SDe-GRxcb4^^P0&$7fDx}jDw~NBYvgR{GGi7 zsX2?B&}UD)zV0DcdcF4cGKl|A*o+Ep|Hf11x1ujjip8|0 zRxRT_;ymexHc!I!s2Wt2Rh`aZTz}vZssNtVH^-I1hFx2#1EK*eN8fZ_NUJ0X>F5jMnr*3=uz zu6?u{Pr<9sgXkKAM;~c|sA#ZcJP_;1;4z!mo9@NwFlZIc}6emkQts5z|&YF-zd~efr0EL~n_PD&;#CFRZ%+C2apn zgco4Rveh;+4vc>OF&iU05qT|mtE!fhsmxfShZp^8k;TrEw!;DV$)EY}$Pm5MQjpXi zuPCpMHMqo~{VXXC&Ak91RS1xSB@=}2aOnHo4B?Z|BB6uC0T)>PGznJjDc*Xh?-iti zuv9XkrQOAW<~nDSOV?Dzz;!gT_t1Py)|10CFB;uPC3;aCk{6Pf0Da3lRr z7><$RRev)t92M5WpV1+MjF-j@-%Z!3oy-ZPya)BjKNRYRZ3xi!hQ>gASZzf(R$pBu zQ_1zNP87Y$>5;1IS>7-#S_wcHcZ~Y?f1CV;%bTTo&A%u^93iK22v#o0c3u*)xo34c z#`~UO+}SBWrn+iVtg|ImL!d{wB%BqDY#oTD#*OuNy+_sZGW`#t#I^f4E+_EYq!T!} zR@>jJgBb1+XSqWVrT8j_YAm!4qCoUQ(Jo8&h2q2&t>!(q|1)Vkau>Q#Jj^+ue}qS* zL54E!*6sX+kfC+g@O#oZ+*FKsU{HB&rPV3YB!|6FLrXQ#j2mAbc&{rX<>wjVjC6z5 z*H;gdyD|rYzKfg*6QFV9)s?Hb#(ZZP{h4wim~*<-RMl41pkS4%R(SpRks~a*0ydaq zYmnPb)U2TiwHJ{qM5!5vaSDg)H0F-%KDW~^|=s1poK7fP$V!) z-u=jbzBsB7!-Hw4(F1aD_3>%q6npeCOj9t?h0EaP?vJ<=7)%Gipr8k1ZQB6@R>__F z%kCqNi>BX^zbPFu#dDkryXFADOL36tG>2p)o}Ctn<4%%ho_p$Z?JNB8i;)Xw;ue|# zL{)8n(tu)Anbny2@xq=ge{(SLN#cZP^B?)=d*JnSM|7f?K^h$^l!afZxEhKA)x?d} zPknMG@H?xodvP^=OC=qz%pMjRQp3XmRo#;(dHpG}8vXBj(%wp1te#QQCSJAg*GVfr z2x`>qN)dR|No#G>Ub%rrSr;P5bS#lZ3gd9>w6!_g~iE-S%Ve5eMM30*CTG-($ zErc;%o;nZJHtDq7Yw@a6(jaVh=c$(O&xYgO9iOxvN8huQ`0fv-y|Tc>rW(t}mVT&V z>9`ryqmi|(OX}*X%}eN3R)DPvhUg;A5s-KBjWKV=EezO9R@!XYXecm~?q<={v6}j7 z7$@`&D1%eCU&amNXU2{Z_f4|&N6wc^ddZ)kewQTc>Qgm$nHuyB;>tA#fbHXfL$%=IHzM~xw0 zFm~;^p=)z9Q;vz_EB_-IqECt)JMR`G&5Wu_V`^`VuQK)yCaqkreLz*?&>{$|l_g{} z`Cf^Qn>}u3zTB%u?)-&> zyXpzZM3-RDH+>fr?4S(#5G=eSK5s{nq}t^(I}CC-z_OvL)PH>k##p z($b7yi7e7nDnT-E?#9)ReyECoxc4VCXGkI|(=$*uktwW;I&*dsyGzsdj0gH&VdCF4 z^H3Fbg0+?Pbyc;E5+7w_8vUC|O!|o)y8I1j4Zj~Z7ED-~*9^-{m;)_*B6L(T4J7zfJ?YEcCT4@Mn32>$vRK%fLW*fqTgJ?i4dLmLhtl7i%h zzck~WIFvb)R-;NIpC>Z)O5(=eb-SR$&=TCOaC$fX-5KJ7Lx+LedSL2?$^?cyOwy!X zqbJykM8e)r*V`Dk?+Kf(^&8Pa*5m(V!oHvK^4%@@diiquRFj{sBs)S^{%eaIlohgz zMSFH*Iub#Z^Ab4{`6w?K2bAk^KbURlg%^)RI#9ZP|T8|P$sIHez0fg8#lfG ziL6G;vQ)9?$gjkWuO3|Ut~}#kHG^h}^PC}PmDP(+7g@GHo2$Ib!c@{4{Y&h7QYWI! zovmAO`{$x#eI0C%!;HlnmJ$2QO4FcHE<~ygRHlH7Zj+lr4&lE*QywYMQhxw$)`Dvf zkf9}0POPC(*3zR%Tn&KERDl~c)YHnid`cKS3(^CI)iA!pf+x79=mQ2-w^4T zPP&YYX)X>?a%NaqO+KXtIZ?E#(!YvTW3pM>mX(Uinf-tdb#;ece?IL7(2nV+NpN*1 zj^D&K{*!iBt_QUQEePa3(QBo;acIuaSjEMbUZ>Hu1yDZJ}#@HSEk0H5L zq9x3#XWO1qoCaZ56m3tiVj0(BBA>n)#*&@OCJ=6C^>y!ZU~LqvoW`^PL2aFvkm&e_ zH|#k1fflH(k=g{vE)%Dxf|x0@>#J%)Yt-s-s~P4+M)uM-g`PoEzJ-oI3eW> z?9tG&t2IN=9jD%S?%C(KhNr{%Nyd}@IcM0PFyXf6`_)NvunS)jmxtq2H2q8~;1DYiJtcAt2pnmI5nIbSPOcJbbVSO2#{ef;_ zM~DJo88NYiRuMA;0G+``(jxJJ?sQJbq+I4sQ}==XmN$^DPqd>!xPc&5Dew`FeLD;8 zgi^yz4KKbu=bc6)4Ih64FZXRjTkJ`e4wxVWcbyBTmI6Q{*c>R zL!uQM|Ms2Y`w_f1Jrm6U?} zacaqdB;HUY>8vfY7@F;hxIU>*El&Qo*WyM^Ybt{rLam<@kqDMX4+{tRmbu zTl4|>i`ErxrYbU!IMC(EsiS3YAb+L8LYJrMp(Y;=fNMO3=9$1k;R3bIPB6X%sKjV+lbD3{7{ zaRE|f$~?Yk@eK8570!hz1Eg%SBHl$8Fwj+Tn-^K@75f=lq*4VGG_JFl8bVf`+tB$QI;NG{XwUk@^0V+h{*1A7+0CwnGWB$2&u~FlkQm;wCf^YJvnZ_1!f@3uNSTH?50B zn9P@qDeT%XDUa=VbAOLM$JPZ)>N9q(M0Zf~x@89b1B-$pV&;f=nur#1bgE{&N_rze z2C9IMq%Y03PKKHvV6#B?*3RNE(yQ5j(t0XO4#%K3NY4VGEczTxeR|f(II*BE&(dsT zJAGjx`xkB*X_|z6`WVSk;Q?w(M9mbjXrZ3t3DQAkc%EBT1&`R{npL&^? zVOue1ORP?#I5uAZl)`({pJN8FPOE7S)=qL+OK1fwB{*_5C)~Sty--g4Wod_TL~Mj} zF$63EFx_no*$`q=k_C%@(E+E0R=^&J%F}|K7~tO7*epsH5gRj!okG55E2=iWdH4 z{#4Oh&%Fzly2Zk+P=#Mpq=J9}Q?Lq^bP7?nEqi11Z*~s#J5Vl zvLvJ2NT9YI(B0lKX7d3C5_?$a)9tj5u94H&BbX2R+9O!G_?zHn)T=y+Fl!_WH%mfa zFG3h5Uirxz0;PlOx;7X#6X_-8L=MM?B5XjSVN8{FB!fSOxSOg3nOT%k>6(cX+v1#Z zdigs%oB$AGt6}6MK6aMDnr^bPWYyqAHH>9y;)h;%e45x~pgO_)UCg3rYE+IS=T^2G zr$y&*NJB*7oY6!o30H6st9uUHM*0WXWBfg0PUxt=q)mqHDn2$B?g2AM)00Ev^~u3? zXo%{9&}$nmAIwLSDS)DKBo~0#WRjvBK6fZaLV{@`mS44N=d8E1oPP)Z5kbswDO?ELOp z`=+7D1*#fMy`hr&l&M!Wk_qJii89^q9&vwVJm0B|pOqO%D3*&l4q6Ji842b#fu%^F zaoM@-O~KGXm;@#p-71XN)HWA1S0NG+=Gp3aa}p>StD+zDIk(*V5S_W~l?C@~b(8Ej zHGbmt=P@=g(|{a>@NNWhH=+WVKIYwBB9eeki_LJ3Vc9vL24acM`quafMVC9)=gT~d zsT>Yue>oNT=Wbxbu*>*>8uTwmhHu>v)Sr>s^kdh2NgPJ*5UjC^YJJIu({rER`l-Nq z-X->rZn#1VAGu(|KlwY3*8I=^L}LQ$LsSyt(m80JfJ8TxIVa&qq|Q+n5A_2m(z;o< zpNaIF?zWgr$NL|Qo4rLg-SFE2$Bo-o&EQq*q)zQ*PqQ6(5&o}EJmrb9kbn%s!FbVz z40}i2yhk8I+9M|isCmF-W_1qbKJy3KXeT+>n3|bVo)UV3*9a68xVGiKcZM(?@~VCC zkQaP0Jd$6YuuQL>7S+$Ek}N3(*rpgX#Q)&fh%q>S|^^r-G8<5Nd6iGr#phAFlsU!6icYHIvfi)uUe%ZO3a)-taE|HfWt_sSz zf7CiwlN@TY0)5}MF{d)l1ldRJGgxx0uxLfKP9$~M$DID~UDWwCD39HV4K`6pn8PZy zPM0JS7uyG&F#7RXbefrudI68XBDX+bl8~I+XYTD+yJmBNQl{Y=g=5Nh3up08^Qi5_~!VooG%Q zOb=zGgGFQt^Dg2paEJGA*Db<nhS#=2iBqpdTI| zH*y5mhmT@Z{Qbh!>(CVl?c6Ji`c*{fmse-MJ%EO+>=)s`@85aPm24hHMUYbQ)4bKU zFAH%z05%(_D_)yr**~Q~0~NM@aB~u6o@$|VBpdbXzMQv35L*UUDHK&9cOy()AHU+^ z$Hd)DPi4del49XwaTQS2uc;n!EchWtS|u0)<*w@=O`Ss_J~_R9>U%Hx$?y7Fp9yk6 zsq2nS2)W%{Hb<$Xn$@_#QtsW$1wZK$_o|Tk%&BuO#X^Pt%ZxI`TgIdihaK6fF(@Ys z@UKQ@cGv;$>AP7}YQnV?zdA_@8(PsjoYr|bIi&qT z`dZZ~wEU1B9ex>;hn!yL`JR&S!?yUW0(^^np&P6O#8o+nqeId91dNdF;s}k5Hx5qf zcRaf?FI`*)eUz6(v97@xRZ0zZ{h;tZm8^_4#D}7``|FRqH&;+jR)uW_-@}A0!=o|> zR6k9T0whY9o}h(Ui5d)x2!-%o0tR=**E^+&fIT9}$u?gZ+%!O+J$LJW6PXb)qxPpY zwFC4m^W{_aZlKbN`K`hd{pR=AqS8H$z+R4@XgzH2G@`tjM5`)dAUD4IVh-NzAYwb= z6t>>2*YA07)!94{x1zT%1w|nAF)#B{I*52qIAP6CRXWtpJ4XKxe^0TUW*HuWMO{P9 zpqioj%(YV}e>JYUVZ#9h#`sC%pC1Zt+%U zdMj19dWWK1dW4=0$Y?_>by5VS&Rq3~Eb-rk9s@_jV|ELFH1BqKQeEkxkKMf+J?jKd za(qxyzxAD0SZd4trPfYXQ%dSDk6Mh>-r&rCSx+emF4v(nacN^wU40n?2}?f8l48u# z?`X-@rx?Y`sMdF+PkDIP&4J;Ak-Yad5T11x9)}<`b zLp#zMmOI|WsM-j6bp42W;5Zs3L!>E074>qMbf@lEgEH+9i=3U4sVoWA+^68!-S>VJ zHvWQg%rqMZY3f>6_gq$`@_a0L*5!xMq_hAu>)mzba0piPH@9yIZ`rkw|2_gefJ&pq zmEqaLpSvhiPZr6;*1cE0DRMYC-B094kci7Vw~5X2-f|fM^GDoN=MT7?Y-2RvQ1>yv zr*ld30-8Izr(*CG2{OPLu(X$Pu{PDB->I3UO>BSgMzg33kPM$V7#7E~@uQ4%8VzEz* z=NTT8?6LlQmcaRgitc=s>X_568gkFk+6)*}udnz@#54HU0}}7&52_btjNfV5_%24s zn$)-4zYF1TL?-=H9?b74{WYCXz>1=;P{4fubgd_1KpL9sQCnSHPDF+bMQNEB-v`uz zzw?@F31!;}slXv8utadKrtzg7h~N%r%%8p9mbc(vo=$9`mS^Ft#KAbYvBHV@&#(Y z&=I6N!qRvn%CLAcpG77N0v=LEdH8Tpl4V#W1}V1^tPY_M}Pt9EO!?N zl~+BC482J-lB%yD(J@VBbVOkZ33JgWFPz1~4WS{Ed0Rboj>_WqjM;4vD$M8Q3Qe%# znlxOU=b<;h3Z^#=&LIPX5BRnO1t0K*@i{^cOlalc1G-*4F7yvRfJ2NEMRclR6jaqz zK-V2}aB$A2SK3I{&;Viv*|uX`;Ry=4q6yW43Ga`$SRHVtv-v``P~?*Oysaa+z&H%V zU2RWMA(b&BsjqzH(=gx0GtwQin%qQESkvOkq59s>h$43o<{SvvHPu8-kf8=Ofc2mm zD<^y?*2%{U+yBLhL_I3xpr{AaHGo)O_}1Rx^il^Vf<|BPSv6r_YKZ0NMq@U^jP(_* zu^`A5^ov%O^$mZ#fBNIxE4eVzI}dG$!goBg?;N9#7B+{gW{XA=0JVt$=7@!=weOFZ zsiO(JkPxHcSH>ZbfGo`>9QhcSssIiw8@cz+q{h2jV|oYbiAH=4N6UQX&^z8!wWG|P zRtsJgQ{tSyaMBm#k&>tWJMiX#)%sM)n@>%HN^;Nn1FJ>&;$M)>)dc(WkXUU3jn;@w zn)vz5sArJiNbJJDkDddP1w2xT7)a4m@L<;r4Fr8_KhM1R++;$(wt@$D*A9mr65&ny z@D=OjC1X|$^;JB;5{I3QLc&WZ;jmp1GgQaJbM(8^LuP+HIP`*QHL|CY+-{|wPQDnx@@fFi?`14y!GOUSyU)g>iMADqFk;eZqFP3UIo9vQHVd) zj!rF6h;?7TX!uov5U{on^M^Bhle0Eq4<%VGMxL=*~hz#E?5)_kk^oX+O%8hlb6nr zW3(N!w0Npc`1t$)$n!o8vXb#bq(cc86VmpChZCO3|4SmvvPO>)3se>Qbo( z9)x1gqwDJAAFCY`3%D&-)GAlQkXM37a@~S_0+KJ{JDz%1M&J4(w{cY)E$pDKpxLmH zb%nbIHomHagN5&UeEdaxTb1{o-fDylkVNjk#p#!>eflf9T#|Rd$~&Z~wy_2m3q7$G z@0m=kuQ~|EaGG{>5;Tp%J1FnB1~S9nxoCk9fF2*aq!-_Q5)F-JwC)ox7dzf%@!?eM zWDDt|=sw7O{Yufo5N-bcB-;F0vV_Aj1w#~K2I!g;hWD<2=nMAfl~Y^C{*my=FJ9gp z;&V?0687+?gaV_KwQoj-fUO#ZNG-F=3n{srS1+KGu;~F4+9Iu#hp}`+@;^y#t51LZ z<_H6nPf+j`s3vp(`ct2-yGGDNmg0Y|9a~#7^kTP48*ik#twbpF)$i>_p-N&NEcU@# zBR{ZNRlj<2ziffV(tQwv39yYLX9I!>%2|LcTO96|byuIk(=+>pSr?T9nub=#ksM+2 zQ+>xf3mF+LR+?-Ypp47AW^9+mG$?_hBQyi{!Rw-#1**Lk(DP_@m&wx#X zDZtKavH)#xp=QQQA1hdk3N`aUUYp0kE1w4zk4T8?u@sob)q0A_XskmK7pDo-k?MN^ zlB#%DDa|de3I}|5J+c*B2xN@_leHM{cT_4S8C!5gVGOEMHfqENgCcKRu=X->jd|ds z5aQk-f?jZs>d~}r@dF=`fS#QTk|6nNbu*9xyEn-!JQ**mc}s&$l04OBRi zE@s_Nla?fbskrZr`lb)>prD6r(ZKLLEysE}sXx1Z`g1~M3kV8fbjGAnliXI;;m_PN zwBsAA>SOStLj9^qBEs8ynjgIX&|evT())N6eZg_qm&74y*bjc+f=}5U(6)#bl%H$I z@w+6H)F2?L**o~%d)|oi;7Uhfw}P3z$vO%opr+~+X!hJAUmwfgk~h-01-=LB4_GQn zH&)^{xr`1JRH&*L{@Jni9YGHufWSzUWOjiT-k)Y zb*E^@I(~~O0Uk|_FT99aZC^2e-r5kjVrS=j(F^*7pI^Q2e5$AIeA2&f_>uP}9c{$5 zE;#q%dRZDMQN~CPA@g`kU@OhzF4@%hh`OA|%Fqajc`XWgb7W>&X~{+5g|C0vpNuwG zTR-$#;@?IrUiMGp>5$el%1CWto3soh71sUKnoS0Z3cJq*WfkXBhiK^?-1F4$(_!O^v_JH^Z;o_)fpvpK2$kdaE2Q)blDXvc0`v$rBgC4A4ciA@6M; zH@yGO?O%k9-vp!#!+DA!`%@!_ZErsE6z2w)_scJVqx0RBPydw}x`(o}BoIun^H0%E zf(e`qA^1lW`%gupS>bP-9DM{yP)Xif@Bn9rS?(o(DZ6SWg! z>4*xeNxpO>-_VZdAy}PBO*weQL@Y#jSql1KJc>wVFDt>_a9f*X?=n0XSW^pCRR8j( zyU;s_C@wK_<09?w-u%F+&G#-YsbnewH$Cu3fkU~#`O3Gyk zvtAMc6peD%vy1N(qKlz*_q-uT`R1!fe@vqoH&L+$wMdJU2@>WJBUoIc)g>V4R8wb8 zr4q2np42xkzVd(N7S!D84U^G-vV1(sFVN)I0YXvUgOhZgOi}PKwsWSQB%LM|wCH75 z81xLc!Z4V8n*h@8%Oo~IpY`;ZzSDKG6;d%hsqD*X_psLCiE&ME|G&&v}A z^S1#tEcjf-@}+%T?j@pWgjo=XPzF$c;nu5<<)KbbV`LX!H{*+cSeL+}Q9EsEvI5*o$1vImizTYm->LAQle$y3P2`w8HVw zW_)Lg;b$Uet3z57Ih!8Rn#ft)Ph;g^Qv`fu%I+tbD{6;de;v&Iq#3dF@43t@>BG(e zl4m+eVF8kUFb<0T3;&O&Ya+Z`cG?KIY47yI}oY1cyJxhfD zarj<}A_i>Nr>d8X{jfR4li)ZH-!%6w!427#kMF2OClaUMdGz*r<`ZnUN0oW;JL!O+ zfk}Pl@-GD+VOxD9O>qQRa;!G%kg@ueo?l9B*YEx4nblU`b>q2^)?T1#1uqYB9MX|Z zlE@Kn$S=x^vd9W4oy0=vn*|pE3a|Vrxs+wf0Kp4 zxNp8Y7rky&o`W~UhiULxnn7oSbZ4b4Bx9GLlOGQz%{fVZ=e(IxCuiCmmC~HJ;`)SV zcjYsK3rGk`1vP+=Hx1?e$PzX0k-t0 z_L(!jq&=zV6X{ zU}{dUlQR;LSfk=InXFz8{e)j;&ub3jB3?(-Zb<{B$EwQ!6 zq03J8Oa1bP*V!=0zx5;qO|t1%72jl^o&N0mD|KehQi*Gi4ChOmsjp8pw7C8A7nbl- z8RvC`Oz+Ugy|qB&2P}rcT?OdzDd>x5Zl+3W*&Kag{IAxz9IK4V!qPk^_~J1ZD=sgq zsEnzayQ-W>H?1RF(9%psZ-lpx+Vm%~!_m*Bd3|Avl0z?T2IR0Gg!0>h--Vg1D3Vvm>Ny09(z4P>__5W{#o=ERkNck)zHi#2 zQ-oea@MDhv1Jd%bPymSotQ=Wwha?O15_k&R7+%J>c3S6Xd|0Adw02BXQ?@k48Zr-& z$<+(CujYgvvwiwu1M2D;^-n(ML_cY{hp=6Z8-X|oj^J27_coFH$|qZ?b>X^BGIo-@ zw+JfLM||)MniJB!^jBSkTQkuR5dpLK6!D}YBnN2~JSvw795g_G^tK&0(Qs{qB_7zw zkJ(x~>D~K&Y9a;|ofGM)b;;Pk1hgn1kiPcy9Vhd>3aD_=hcbA}lD)+@RQ!(I6PN1i z*6yU@chY{3a7D|X`1q?Y$yhff$2&ccIai703k{0>qcF6hv2@rWgOOb*Qe6D z&yhJK6SLN>PkdpqXb8w+Jj=u)qjx|v>9{i%ELtw$!J<3ZfXevg=SuAwGwU)L+Tw5D zHhvFJrx`rlUF%|9A(kzB=OG-P9i659`$odAUxCyKpmek#S{%On@`>arJ&e8Xj^2yX zy$+KtRXi8gsJXZ9JdF}b_?HVRiebRqaP#&GdU^r{VjRlOY0y)g$56cg{G2)<;%v7>hev1Ipn4Tumz{Uv8A@ z0fcY<{H0B7e2*5O9AiOI_|<(M?G&N5woAj@gRTklFx$;w2WX1Rz?asJ&V1EP1ZDw~ zagBdB(aYjeSJ+@et z07d9oT=ZX{*wwqPylt}(O#RE_TZd7Kug&HS06IhhDlXv2_}~1=4sxE#NSwIVouj^h zl@x9XDu&1&;cr+r_NBc-knrzIV@+K)R3#pRqtxf|5GwICr@kSP7y{D~Mf%?H)(WmZ z(@q%DPN1Nox?wdG{KUlxu!UOv<(tGBnFqs=XU7M&K+U}NI?29?4I4M2dYqcS(!w3F z3@F^Ts5G-9JFGW-k^0ERXy^{H*$DSZ7Ok1}>03{Ra!*G^>VPjCL~r)udw$9cy0WZ1 ze8pvx$bZziY-kZqz*ai}7NVZkJ%(kfs4Q9uM=!Db(mcw5qg#DM-{L;tgpu&oOD-=1 zZ_QS#jf59ZTCpc&R6-25!HwjAT9+7JQP#hhf~81+CaItVBa{44URD{t;?0REeA}i6 z({Y>qsx5FdUBH#)d`bUX%5>Lp>rA(${hsk_j%&l~NrBq=Jv2S$gUu{4*wBzO2E2&J zD{v#5u@p@TEKGM?vQ$Aq(4DC86P2*mr>&hS>i02;OVJSJ0P76t_?FF9&u&r zALSmQWg$U$dM?$XE-izPzBK&s!uLyH0PR{P-*O=0-f!mrj)Qig53p*YmSg-$JJ#Ar zsw+$69P&j~yrG&)*f4?B*SvfGEkp_gIcF^KykwjO^K2D%T{W15oFwIxk)#rX60zvn zF+K6QEZ#x+x$=n-C0+vRFqCTdQo1(`$W*KfxpDIr!6-z8irHsMp@=u9zAzcQ@nIWm zQ?~u$N?4$z&h#nLwKFOfTj|Nu%J;Q)1Wy^5vBf-1NeEV~nm%FvRot#sa4DaRE#^?I zoUujxs#VIxx`ATZU$}ouE0v3VGNk>|Jrl(^!k`57KpYvw?CQv+AOIZZj80orzC;+A z253F;yY(6jv+6xKG=Pa;U-L3MzJn@fxhKCMKCnOpu(9QbavTFE;fn6=K`dC2a-DQE zvLoT(!@GC?Hl1?q7_-$Xx;Ib|xag~=E||IF+&)_NCGml%X-JWA>z8ag5w|!fYN6Z? zeGG%s5jH%^<1|My9@JnlvrpQbd$HCdULA*EfoK5`bJC|EMyQCx*Y>RK!&CeBRCSJ* zC&vO~l|$LiFn6HV9f?{bCRNK2!K9k$sTU`25TcTQS8VrGVk8lUm6Y=^lYmtZ6j8{& zB&8@H5NNlSGPmFTOhVQ2AfdexQRh(@yhc75kc3Nemn!>lv<28}Smfo%$1 z!UiQ85RVLjdHdQ=xnZ(M(Xu7H9%hDLI!!cexH$pQ>hS@ITExFtL*4q(Zef98D^8yj zMcn+;rJZ|o6lVj;XDiy(pR?F5gDO#6ALs`hLZvnLv2I$wXty|4|Jw1+2`ki4&U0lk zHbp8mn~;9z2_ii$GZxcKju^jMCjMrp+zYfW?1-sO0O~+y$d-ZVrD>)RRCf##u{f|9a+g)tZq(4FJ+Nz?vGv5mIhVv)i=k?_(xmtH~v zef9@3)HD3deP6v3Vjf0ynQpu`@8V;}Izip`PiBD(Otos76 zAj76;a)r+omQcTuMFt!FLtLr&-$XGTV>OEdC*Y=gTBnD!qY+>LQ&JVG6vT%%)yBCEautiEN&SgAuTr>UPOty@mtbzCSV|vjB?6;4 zYS?~WygnB?2qI27Ge}z@oN;16KAJI5eHHU@z?pl7avlhWL0d;)KUNM-upYU-qnHHi zq2JM&q@4=lR=4J@@`Eo$o2bxoqzuNIhSs1?V@#CWcy`QIPO7$?knGnpvoM(O!7eS{ z{`k&Ee!=vR?b3e<;NI}w7FAZ3$Al-AEnMMkZ#{tuPOxP06RHOl-n;G@q+Ecl+hU|d zm)AFUZ90nK?YDFWBrTQ=)4V=oYa8uEH%L=R*}3&v?q3n!7L%#W;zH<;Z@iUum($C? zqIm{`pND~kcU7RbpkHwK@Qn3wBzYp$YU7o!$_#ymFr2CsyI-3a2Gi%VMOPM>P)0S> z?kuZO#IUTxC>;4o{gDsfe4bsJ#>H9=&08);cRFp(LpWTlJP)2W)N^CMoh!>0o;;P# z5*7(A$H2!SvtnWw6eH3NmdNs=KbC}Vc=GbIi~_A4va?EPtvEWH&$6VfPpl-;pUsSH zsH*6jR}$Xw#@i*tgpjzIUxvK*H^*$>7h=iEdj{;Yu>*<)8xu4}nReCz906hpI^c}S zs>EVZQlI_ijCLS>*~SAQ&2WyGN*jV%wUbNU)5lMl$aPeNb&A-s^GhdNE-WmIQkWn) z&xD;BwT4j(h0MK$;X5Cidn}hHR;fsQ49tsN(;CCG;IVZG;Xaw1Eow309Fc5ePF0PO zG{`!|=Boos+ayiXBNnGh+q8EF`ipjwbIqysE;44q?t@f~q&xyqW29NX{;K7F)h&W7#jX^QjBR18r1mANaH2toLl^nKfun|{TU_;&;JPU1FANuthT7wp@ZjN;Yw=a=3^J?3Ood8(qNZG|r^ zrscvyj_U9=RI5QGnxa6>GLGwM+38haoDv#Fni_;V4Go^cCN`__7u>L`FK^wywvTt~ z74qV!;mL-+0?J$L7J4oh-3qOOzrs##y3%A)f58H&oOCa@+H5T&5RUS6r$+IyEI zuUKxmcDTGtPhYjanGwprXr1pc@(S^CQLB)Q?fU1Ra?8G)UOjyQ9Km}+!2^o7r?1TG zv;LW#I|Tj6*h~imkh`LB6^ctQOh;M60XieEZqc?4w+iY@q|o?-)knpe{DTtJ)_+YYrm}}l!M&_DqlB-o67_JIoduQJ#Uvs8awy`8jJKnnh zC*y&%-I0qDn>l^@^)K&25-H7cq%2fU!KF!k?n5`CP&xe$XB}QA<9!_(;wAMZ<5vBH zAD{p)9UqEvp@8S2n<*2nL%^9LRx+F37vt|nQJza%J7E}CH` zF0De}7`Tj*`deQB+2XIz?5v04L{)Wl7sJy>oQT(oa+F_e zeeFD6XulSmQ)&>H3uW^?)W`Ucqmzapd^r#25e1!B6OGhh*EJ%oh~(Cv_MSBdzhXn4xXRRhTcgc21|HZ6qj-}e5yTp%9hzfl)2{N#=g z)=`~rP5d3pE4?VZa^2fgx%M}#5*3y5!_QuOI-m8%x_SyZ&>E&1v9_lB3n7V{F|hBVeFpSG=vL51{EiXF4Z** zQF`2(=id23oTd^*67(FFahR(pxPR~D4XF7-$IV(_JY1=BC_z!MWhz1fyL4~dvSqj~?c3$3D$iG2-l?o*KBj|qL-TM&)*h4)$+wpM!>@i`A zL!`Qq5MIL*w@;+M55KT?Z~F6rrMIjNvA*TLO045KZV!vHPE6;YoQT9xea@da>xIX2 zpcDISeK3e)@l&0<@lcyo(qt>3JWD0sd%>3U$sgP;?gf*`eIZomvE8XkN{(=ZgE}!q z*usA}=t3PzQ=M>%-wArg|7fSRfT&X9kmz|m?#{_Svxqr#V$SRUhhS3w@`@E*_$i$U z+a~xc*1+s98V`q1>B(ViWp?7Ui$KOdTyR|d`fXoPQB5mgkx{_mOfk+2@S1c54Y^R} zl%I7*ukhs?HX?}vzLY*?Wqsh+t%wxll_NPO4OQXlN$b1P~t{XUz#E%=7Z8?fz$?OPkQ`(q*`BR*l z(w6OgwB>xv2O?$50?N;WFCd_ZBayGlg7Wa7;WD(fR6x6>FQF=viW`uumUlt4|Jl)+ zK}b$OOrdb^z|35QvZ~}?s6|Yc=#cx~)$`e^DZ>Y-HDuF(zmg?7Ufal&EvdgY`$3e$ zhDOMhol>rfgKa&dqxmBuJBA{&Fg|D~;>&BQiYbw-0lDug48B6Ri-13VjqliiSw~CK zZ@phJ@ouKi{F_p#=27Ci5$(BR)Eo*A5Z)$mT zFDrmZu+~4Fz~|CNcO5N4h<4e-WM&t}IvC#-KGRM+oU-^D8Vy91 zc8De#V1>y?mKczSR^+_YMEs3wLjkwiKvBsEORlj}FlQ11Ak=bZE0R=~z4GpdA=G_4 z&ixKj6HvSimCuj?i#)mTYxmwCr}xC)vHW80(8L_V5&J!J)1>~qGp3-06f)UB8Kikt zOy!73CeQ$~R-bh9XpwxRwCZFP!o-vMlv{5oW0WK~@TWy{bv=;p@^){ue%5XF+ru^?QEaUyaU?6jL4oB}#w1D4(wee+k-MhOX+*B$5g zsQVvkE>u+|>KkEOr}jll=Uw>}U9Fs6zYoxpz3bqi5D!V$g3aqt7icMBiiQN=U@^t* zw@!}}q~K->jM!vK>KjbS6cq-c>N@JnDG9^aS4Owtp#cZ!0*AE-S=`EIq>mW6@P2}W z>}KN^jmh%3BN~%MaNx1i#TO7r(jBejs4x;&kWA{gjN9~xP)C1E-j=%RrYgW5S_(4T z>5j1Cs;`|nX&4a{;r2kmdc29acCLtFJ6QIE==-045f(SIwoVD^%O|VAtNCG z!}_kT*X*Hpb9x=`d#?S!#?S2aE73I%#Y)-!Q&j_f+L}74Z(s8Me=qehd9zZQo&uYenepr zc?AWL@=9)s-4}UE1>y0#KROXNxPyEkDlmq(eDLwZA!?JIawrFNm^1asF!LG<5Vp(Z z7w||4lQwrG50DZo)5bfRg^Ve((GPhzuP6XtM5%Q@4B^$KJaHBgQbtTtyAkI}8tdDT zvE4-o)s&rVW{hT*oReDcm`V{lG+o8zN}F^jGR{ZJ9<+FL}}ss}#@ECoGusdw#;l z;!Es=aX* zsqTR9yM zS){Tx=Etj0gdU-vOoJ-f)*nsQmXma+RJMcco;?Q1aEhBHYl+QXNj)#}*-hC> zxmpm`E~=kQdv~TN>f|3K<5)8W_H0USgSAGOx5BQqH0!J8KZjy0O5NlFcWNOu)y52e zKvh=NwftP{hlGAp zy*QTgy1H70MySg;5Skv9MnH==&_8|u_&Eu{T}IVsfM#i%oBK2mXW|0FDv!P%tJ248 z|B{k`rH!FdJ4!w@e(jVbGe?3aAAGHV=O%H8od2STJw@R)Jyu zGNb^4xp0AF&b>KqBQ#adf|~W64}HxQ!%`xdypGO6#k{Rdw`|uj>7rX{fi?f8;nOm^ zj&jjyLDh1?^&WiJgj%(AP1Sh~L+To+6#?*xOa|&sW^m`4wbMa~=p#Y1t7yDfoCZXJ z6S~W8Oj)yM>q)p-LGhDv8APm|>vN!o&uwO2M%}m7%%IZOw9$S-gVhZgQfHR_=!=~C z>Ud*ZR5XCVrGB7x@6w1VY7vky20?en*sWuk69`cZIab}Ny@y#9!hAWYk6(Mm62ZLx zJ3#EobU~+=CmKp*zZ7$|$;i;ghUOl(A{Wm8F-mB(Ay+IfJNK_nz2?uYu(VWD7sG4B z`SRo{NdZXXkt{7g^W*TF0^Oh6!itQ#6{DuzNY=refO?2gR!PLc3A?Mk(lBuV18u>B ziWgB^iF~x*K#jh_@SG)={pbIq`Xuyc_=-m_*QuP~UI9xS+MJXyJ<=B;yo1eI4k8t$x-fX3eo(Qo`+Xrb}R~ISxLnMA% zMEdq8-sV)Spdvu(5-5QPVZ$z~dk5IpKk1`>hf7woZkoR0@{OW|NUCeNJ487zjmV{p zqm-r$$2u^&b2;Ks9fSutpfsqXPmxIiOg1&ARs+lbCF06_9x%c-}~l~SLqJR+@}l(v(K@xtRw1W3K?2fDwTrH(Qapo z#)r)w7E!lO?!dMc`g1{A7%u{_KAeBaWV<;_2fk0}z`k1F4 z5UuoDgVyAJCqP&raJ@J_B;fS1vO%?V1K6W4JN-6$Nz)@cHgPwXoL>IL)B5l*z&kOU zgBtldNPTa+v5;d18r`dRo!lY2{AVD50T$-+iQ*`9YdJK?=;U=I=l(@Io_=M6gm9L7 zk8Z(Zw{Qw|POqQ&id28XASn;d01hE?!`en~q<~$5GVhKvMx^V{B@)#&42lm`Jx`Oc zllU!b>-d#anj|PwM<7(0ZN!voB)`1LLmeE$m>tq|`|68_pn0J>g+mr~o=3j9W7R`p zt3|$?TKM+}eIOQ+P-Wf%#c3;1#1JX@=9UiGvsl9^PwovgMu*1hsm|K>@JQxDC$k?( zi74!>c5=v`#C%~BFj1*5a_~`u;`?!>Ult;^xp=8wh_dF?d{}|s_ilT=>OwHVdCBCI zWB|1tzVv-gvJT?k6^TI*?135%+HQ)qJ|q_LNn{0d?<_T+IAoD)8T&zOyFd}pK4@uB zpY~jQna_8|ve&sT3RT&3)7$SIn!PIR3nrckY?TU)ODO!_?d}EY_i4LCVsjaZjE5>+ z*yN%MVoQSmXU;wk)!n@j(oXjtn562dY2Wt_DOZFj0NSF76$#RfxtiklkSeZsDKgj% z+n5~84xwVobm$7?Jya3VEm%lO_yZ6u=DD;Wx5$0S$`bB-Bm08b{mH&)cIZhHZq{UV zaZO7E4%IueHA@h0sa7l5Na?05_w|hrg{h!H?eP@t$Qt=NO29!bgrk{X(3kA~l*4m{ zoQw|Yzfb+5@Iac+8l?j4wbwkmal>J37%B2K*Q8o0`6JcuYDaSQtzyA!iT!zd7A1(K zSPm%|YLN#6<_t{IY2z&r^7q>YR(a4MTo_oKM=MUu|DaYrJyUd%?(KU}cA=+AC=?R0 z=(tiIlaFg8mB(si7MmDLsOo7lueur<8ftNK>;r;@yo}7{8%qnJDu-&x)rFH@eBJQn zOaEYe^|uTQFkr`GsSdOZ*ss4~&+XMgI$&3Gc)Qq~0T>Qw0Z0UO*<)?KD2G|r4{X=I zcf|wbG|Rv&>xG(o|7fd#SX>F-$fd|%8XB+dUq7@DOl+6L&1g6$%k*2>h+CiI76n1J z0@K#-U0Wuo=ga1dYdPyq?xeSw3L(-3{~b~LX`vblI18}5uKM@jRAF90nK^l?ViT#) z_It1w*dY;UEcX&%eLN(u*O)AJhzM*_oLKP;+)Bj>^$GX9+78r7x`1o6lhqT!75z5% z`sJgln5g;pjaRc02NdgY@PmV-*g=I7#_>SK`zIa&>dn73mA22z6TTwm!3R6>avj#-a;Aa2XvqlvMArh0SrNr4&>_p zfZ#Gd%f_OWz;5eHV+xV~UiTmFEi!_NyW@^P67uNxfC4NMaS(DBF5mU{VExx|`9OIJ zB4XaF-TZqYrh};ey8~l%7FAo7_yJ&4HX%>Z%-;F;LX3N|*cKqeBb1vXsl;w2xA+VD z|Erzh6!wRRNDG*Lgv%s_5op%~E2*)4PA~tiU1|X&_q!MOU1XR<<jL1Uw)|H5Ld4@E*uN`OY2|a9;Ct{W23X;xiGB|c&bGmVlR{)-2URD0!schffST@ zF@!wUI=?G`J(DG}gX}Bu_<|H+Ne8#qVCSQeubk5PlffC>b{!Rh&*|l#t(?N`6L1az z4u}+Vit-}u5nc3u2ihI2X+!awM7b;WUi~^Dj5OpSBhq>(_ewAOd$}HdeD5!LyZ#*| z%q8$9z0qd>a{uG9EY5!^Z>T}IN}{;FPhH)hTB_Rx2btG@-5U55aE4$+nyC16NnOLm z`mPz0CA%v$xHEPiSoU$8@zcLJnPb5s zTiLc9`{oaz#)2PwTDic24L+)-0d^u1KLX*i84M+VqV8I? zz$5#%9EfxP{M7%hovs8-K?#zcJWE$0j4^BH zQ?OD_ugtU#=fWKLeUKQ}5;U2frTr9~%e@$qAHPLpNo(25S_3=b!T$fSafJu))`$Q=5Z0g=IN+0$kor^I?EoWotBhKvBDQotW_+=%DRr;`$O*3#oe%ArD%Z6mmZc~A>WT4Bri5#r@3mO~t5>iAR0obcB;>aXvgzJ+aUnODO}%bN6gj+pB=o7^&_G_p`byc^#*-|kjE!YAU2HSY&MuF1ALs^b#*57(! z9oP64)VQD41BJh35mpcXp78dyPY8+HzZR|9r~H_Qb%W#vVdzk=e%tCq5KJwjxz$MF7za$b;(f%3n2BLl+ zj<$vMaDxsPy}*xcqA93TH|DS^$D00t_gAjZW^(vbUvg+$q^b#<@(O>Qg?>7N-YRnq&+GX=HDUJ*No32(z*Jx2*MMSkFY_GK~ zDJ#e;39nea#z5hi_GJ})@=A;UgjO}^BQg8lal=Eo$3iwYzj3sRxMATJ?}yMvqI0x7 zQc&ExxB%^M%BaIcG`!>CUDHEMKa(afj6O&Qu*2T5ZYr5tFAoA`g)e`89hGSlaN~ij zhsJ8s7hF~&vHM)K?vQmR0>;yF%tc%qq;ti-mD>?+u zcxGf1BLk;NQ%5AfSB<}D?WyNrq8i)-&3JKb+5x=WEKGm@qg~vaST?3X(;s?-ZkJ67 z{rV{nePr85j+RZwBKoRQe+~0ZV=tE~su|Km1@8Ky6Imlr4CVVG!+=OiQvBBSYFxle zY8nTFnqztxtYbs#WRZMWUz7TtmzOQ3?Uh&^g{%XYx+F(vEf6JMN>{C&DtMCHQ)?e@ zK(RZjx7^f_&|h5l@O1(exiT<4rW;Y!kO0C}>#saNaf|I}LC>oOtA2R;vRAhp52$2| z29W5r%U=N{V$|j{HlVo?jSI)V^A`1UYa?1?gE*TnHP#G4XNC9>Fz9hhJMuu>7tgmR zANR<^3ae56R7^2wfd1%hJGgOln<8$Ohwk0gb(ajSt&3O71$?&R@inxCHbvAEI`=e_ znIJ21AObi*kWsLJq!GAVh@abSWz}D!$YSv`V~@fEmdHM4Fsu9G$43uD7t`tv|F%E z?ueJC9nP;L^>3bB3<^VibNq|3s&hYGr0XbB+o4tzYQ(nDK~A4J;+1X~s0~)tPCiNM z>qcFMb}-aP@mQ^cS^6Jk5*zikm*2qmA-jm1@nJ6%XsTcR`6_`*+=dTdB~johIgkw0 z^?$F?@7OZyErCnahmS_JKTqnj%;%lxxlfz4Fg?3K>zGrh(BT-5i*Oy_YslC-luO%B9CZP2mKK5f18$cg^9Jy4git z=;@!e9=50Mg}pKLv3<1tmanWU4Su$EqJ3~!7D1<~C<>`LhIpH*i|gy?X!gIcTneY% z=qp?Y`&U51jjNWuB2MW@df`9+A3({)tEB4>EhQyn^{cL2Lg8N7McwJmLE0%kFS>WS zcf|M?4s547O>~+GMqzESRz$riK6~-H(PI5a(aS&Aj+3iW%Z|zLql9AU!{^NsUY@b~1pek|`Ub^^K&Tv@-j1Q)356kqlAuYwvqAFt{5UmTjito4)8=Nj5XUPa$?&JKUQ;@zIy zY5rH|#PH|RX>TtN8KqkLsKgf5N{-gLTXRKA^U9+|WtB=X>7*UOll6~;@7%cd;}ED~ zJ2a~+EzGMxD~ZY1>G#T`iczn@hG@rmPg^`j7|1xvN$i3e76xabi zDZD5=e95?z@qTu{@{+Q=LK@Ee5=SkQDvcBh+9mAIKQWMbWGlA77kom$tl`Nj>kU4lR;%4 zrlvZd*Oi(+=2Po!HLizLxt3sCq32ahV`#^#k^IO~{>j>j>D~e9vh`yWfU^^*{O(#e z5Fs1Mk|fEvBg?wVKAjHF@^m^p!I#A+^+-Li&VQ}Y;1DWASZ&O-HC1V0 z1yDu2^{>{xzKQ62POm?tg^(IZ(jaB&Qa`g+&%G?&vlv_3P~3sM7wUbVVR8p**=l)7 zed`0)KPx21vV&dU>1x5EOB1n5sYgGud>%Lc;2rcp7qO16R~?LOu$__R^t$L^*X4qP z)#jObBzj35F5(Y>pka&9mzR|k7hD9=4zn2>(P9;mK4dm~XXo6fLa+mNEsem`7Ojl+ z?N?G+te!5|KO+G?n`_$4=vy+kMZ+IIzjQ<>_b14EkUT^^iix=#Ecc`9p1y?duK=MD z*Zz><`TA~`E}&C5XS0Ut_-vqpd-o{Qw?Yt7heVuPi55MiYB@=nKH`ICWOiLkMQm0v zePw92=};%F6qC9sK0wn|EW23N+bfSZ#D^qvi=}$Vd~HxtU$gPvde)KrGXZJiViahC zWRDYON8{smFyJw0%sJ34o%#bNk|bDH#nCLSUiDbl_g;17Yjo+Q88U5uBPN8tx-R#h zM{ikzMNGK>bobtm*nBuq)?>g zs+PeJauN*#u3~N$<=$TnpiW3bmNH{}sbI;NaqevP3)^}JLOcx)+){vGeB4a^XpjcO!IFrXH z!-~R>wUaEWdw%31P}2UAX2$Xgh;%Bg;dJd3|K|?s`Ressw}z-yT`9Gydu;U${0Hc6 zdH9OUCWTnKbKY6sMqeGZ_AwYnsv2t8K+p1}KmM~wZ^ut=tF2IynYSCogd4@g1(uxY zK#Zw}YaJ0LW(#s9qk}E3PrrHizB`5T$mBGQMJ)p=gYn^}LoXimv4j=pgBPz~C&uU7 z>@Z#Nb@Q06_#XAwju2&RtMw^Urd=x#+rNT?bB`jpquTkSFz9*s7hCbLW|i59bJ6em zbozZ_&F!SVF5)%x&sI&P#>v^j=;mWmV$)kpYoAQi4wSWctM&Uny?nCRM1TzEIH)K- zPrVT~+?}i)h2%_jO2%uss%B%¨_Zllry~Z`{k;KJjZNar1BIK6t{!X8c(@jPFgZ z*3r5*l^2zh5)Zw)Z(b?%)57pK^VV%A+hY4@q@;ID{d&!w8`p&3F$~iOjw^G+o=q== zn77(6EK^OBE{P3sJX)iswNucvG(-Bxc5*E3h_iAjgrvvX4@6uMD1XL^Hs~|%fPCJd zK^TJ!);_9Bg-3PC^iZ8cpI(gQW+~}(E%; zb+&{Vh>IkDq;Y>1U@x?R zGU3=>N}`inqjjjRBj=W~Iou#dXvUC$Ryh#jD;PeN!kGQiG&^v4TiN zB?U6TA}39E4idQT+1YP0$wZt(|Kcbl53&q?@cFA_$OX~G{%cIOydQ^i$OFEd zkx<@4>Rsg6xF>|-SB`bqZhJ0CpROzeecYW(P0v)yj;4 z1hyUs((>gDzjJa1e?1?#qQD=mf^y6Zn7IP61A_lSQadEVJGl`}*cIHrdrMHB(+MLo1mRqW@r9QP|8 zSrKO51R816?)1GQH!QP>1;=P%5yw?+eY)qlbujLbD2C86yK{c~+E43P!Qe}7qb`Su zfCrD{!S@-&fHcBJ1oOjzn}p3tpYis`ZFnHortq25YR8rc(duPjO>IKI=f?TM0>bK$ zw>yf6U+|$R9D(plt(}y?lKRV|7Jnd!xWC!t0wJ&^jsMm{uEb%3M%|S^O7gkyQ1$Z2ira&L@{7rAtsRenIDmWQBL(m6=Z@Xgjh%5q~@d!oS$6T=YMN(yL?1}*H_ zq+`;)&Pn}i{sm2{e0=q4PWQIqkZMCN3YNKYTYpYt4plx2z#|JRWI5vK?rL~}36yKgCD2-~Ds zfuOND#YMhj+(}uPjdk@c7xFWZT?6Dns3I9BbQt&Xsd^V_38#vwrPfC>Sn9zf9=mxk zingCbFy*ZHAixr%ttPDo{G|@HRJm_wDs3q#f(5}%_&@rDFCUyPIFUb9W3uSG4A^aW zD50=r0HD@7OH}jvNx-Vydeip_M6HQK=my<|z@)?_h2VzP85mO)Z>Z)l*;;7q)%u!u z@4to6K}HFE8!8n0wgT@g#q)ZW=Dr#$DD}#=tya;i5C-^5C9is=c3dp=Fojw*cKT$xFSzc`aEld$Z=O4jn+p;5UF0~c;bgd_%7!d=Hc%3R_$#~$hZ}L2jWXu*ZXFt=9 zp}I5Hi%_yms3HSz-I|-X6G>|$Y|bZZ-8`??)In#tdD-K?;Mdsvj66KgYmI}!RtF76 zBA$NB*jLK=We(1XYMm5AW&I90G)unTEy~XZge_Q@pm-<=%1y~44#@E_j&n*Ij);R# zP{jD+7%S9B3cBLH$=w)VIKQo%);39Ew|@QTS!eUloYr=pJ69;D*MY2%Q{ccsk}_DI zVZ~Vc_~j3c5~3of!r_enUN*<#`3g zl^0P}0MlD8L-maFw4=){#PSSu8p72rjRN{Y?=o_gLs3XI*newnS*wA!s+08j_hmW8Y0&L#NBJZBLdx9|C z8)|g5P?DhudHf$dIQasm3``SG(Yn>f zlT?|6?~WDovVPAFS!IUxlXJ9FhQu#L%xxna1$MG0Mpmj2h}dgeN0ssTjNGScI!g|G z^GvBo(5PqMedtp`CYhk3qn7n56WmeD7XF-vVlsM?*427$U3`7n#OYMrPZCWkJD^@` zh+TrB=cp_riQ>8sZW_XGG8sKfGcwrDw6U|l6pK_vK72mn6_41wt`pC|*#f<^6MSB_ zE&r;k7rrDWAnk?8lyzDxl%+f%kt3YhndDQgAq5nhip9sk*(=sVCbN{xYyD&`mXns% z0~d5Ti`Zwo=D`mdz`~@@YdrT!n&F3L)xng>l2yC0DW*567aksiUmbzX0KTL zIl(@smw)J~nn>FiT<(swa<4{?nsh(;J zLYCr-NYX=6A2n`AAC}iJt5Yo|h1yT7p>Qe--`G=Six2dKe4VJBfW($ye8@jW>yi2; zzCM)ipK=Hb%K1D^s*|vxotP%oOV%{0p4z6N5OCY^S)v_PA~Ur?q3}_Hl-(p^DSUI= zpun3YM$k=nDSfusNNI74dL#$`j#+_Y2da2X2ZE$G=72u<$Sm)`VpxeA_K5pya+%kK zbb{5b&ACkwEz2f(FpHfRO8BL7^NF!OKsk?TzDLgcE)T_XpIZj8`>B<&?~&vdX}L-9 zR1j!EmtMX91@x(*EQySSV+PuRp&iGE+Os64QejPNy*Bj8J=dyVM9d_q-+04QsN6)$ z%uH2kr6n#5Yns(sGNbTrUrRh=7VHAD6z9O&x=Y}GL#p%kXYMEhM-)Xqb0MZ$5jFM0 z&VjU?7+72URM8YWFe7|6CmUL0io^lQ^i8sgM)zuKqlloVqr*YwrY+)L(k-Wo1 zHY+MZSy48&Y2UeX&d0=2rO6#-$WU3Js-_x6zT&6^r!QZ%{d9iJ5-Ykf)X>M2*pF78 zgkt)Z&)3SDl5Aeb;`kNY7-J?)xkAjrT-$Re*(hGDX@C}#5Y)ySq)%SESQb9?FVkxs zTuI#^Q7#~;EF5CkWj4M3z?=~xcAi-}=^#GMO7+$6?Bm3}c13I#hg-*b6>xBLHr20P zc|~`I72C&QxT$YysIN;V^xMDwkV^#$8#$FK5iTz)OPGti{aEXc!xX_}=3$9rc;xmc zrR|*yz5#>{bqL1);xbvUlqBbeex)l~j$zT<8KKk^YD_;)f{!BYLQp!*Biwlb@Q11+3NXWladn%J(h379Hy^<=< zohV-~>sOgy20+C6_w~N~^4If5hm0>n$WIU$<;qX!S5aOTCGQ04#PlgC%g2N&2@xKS z3oi42@%uz8ntbVNMT@X9-*Ju7JylMZl%_vycT|J0K zD*6}0_fk++S_=4tpZV;oBLUVUMZp`-(s#|K=z^Qng~e`mQy72EiivQlJJ-o4@_ z^~*Ui{$>09dr!u`P~*-*J$Q-Kh#S{le{IM>A(dcfQej12F(-b$_tG_Qan(DkW}Kha zK!USfO(0XKo9l4FtyGMLl?;1c2?-%CcA^9o((_G1#8h1{E3WV5;1gVH!p$1k@#A6! zEVy&FHt9YV#kZt?5+Nip5{3yM+RTnLe`?GIUrB)NDKJ!5&4K=O?cSkNOme6 zoEm~O&yLm+`e-1(@Elw~;T&_JKd9vYEr&r}Gq+|6TqMrMWf2Tmzy!5Gt#SQ|iF2YX z3$YoQDya{plu&*6iuL13OlW7;!$*!90?etPM}xk3+GAvVmW7>B<&>r9BuX_?Q)m5^ z9dDsnN$AH}BE=CgY^v6cD!-In#1it+NOOdX0)^J&sA!B{mq~ruf(3I(!^k$CN7$UY zt5`F~O=HQ<%A0w8`hX!Z2Si*k#Et%tKYj!T*Gc^qJM#>1$eZtfbnu%M)0A*7oU2n_0r8x}2| z!WHL=OH(|(a@CWi%v(~OI@4Kk(2~uVN6Re3ahi@=MaH6#os_zyP=Bq2u?vDIi@Kuz z{i=`VaO*XhWuK8yO_rDxOpOS?H8NYbeOQOlAGI;e>yeCHS|1-;U0h!PMT!M!6`C2m z6Ymm?Nt7LJ4Q$Jf{w+#ETMzVS*H4Erl{Dy#Xj3aG(2WSxwHAR|kfwxfm#@|CGt;!# zkiaepAI@+5A8YMN(RBp~p0e^IY6J(DT0BAP0U0z}9IZsrj95`#v?vzsmmiH(a!ubk zx9mO3QPYc&oBi|6#>-^dXiCC`@o(JEq&(cnF?W|SeZ?8wkRTY=viN6() zwBj}(pt*X!uN`~Gks$mzy&}FktU3s12(I&xP>R5oGWRcxXn&s?FMHN$a&gEET)IKNbw!_p?80lSH3PVeISw&?`m7W#Gf*+Bj z(k~i`^)9|pz7gI&YSW)Ur1|I4yuRw^C)X^!n~THI>ueM#?ZZPtqWb*4kWr-Nl+%U) zIqV0PC|fmowra$RP+c8%iyt}2G}(v5RJ22q z6-fy^mRS_Mj0kGup>(2eWeyfj!Y-g7HhqWvt$j4TfO zFe8Y^D9hM^U!5*gjuH1U3Ubs$unU#F$S{mHiT;ZEH4`ppe{Qyj;66n=5`uUQ_eY{q z>3j^RM~6ls+ny8MQ8);qo7P1%iXoN5j7jmhPsvVVw{*BQMKd}!6Ne+2CFHX6DaLt){jljEz-I)x;l1JF`y+c&FstKuD@T) zIcoC(7BggV)b7`M-@LDC!Oh?HeMKKEZdZD7B2gd14MF)%Li@TVv?xhb>04Ld%`rl4 zgHVRk&U6Db)fTo>#Z@*xTA5lVUA$rF^Rebar9 zkJXNe1%N|YFX?)-rO~|Sq|aGo9&Ha~{Q%q;*pIM^Wt z!%Uk4NZEH31<=5C`Xu~6**bEp@UL^IV&KUF1vRTmo2`Z$$2%a9n(F_d^=NH#j7;SE z@;9#U$!E(!4k`IHg*1G7m~LFEwMSjQ2ra1)D+1!`mYzvP{LuZRBMJ8>ic=8ez zhWD<2=!*~>!y45ADUL>|6z`O`p7@CSaf!lv;bqhBxRFck_A9j&SWH60vQBmvQMQ;-wkSA z8a()SB>Wtpnm}@Pk1Bt;sn97m`B#T>0mZ?u4@_|4LsezZA4b}ZYl>zcDe6BwN7({l zz++JO9!Fm8B^w?yN@Zkj1%=PSl$al;s>u;l%+DBv2q5)+aE|Xo{#w-c!8zg&N{OV>{Lby!4unec zHwq0>-NU5*!n*qx2w!wSX@2LB2gr3j#<}T-Ynm9joa(T^3O)d_e@*oq6R&^u{70gY z27Q-~hBL$R4fke>4N-a^Dz1@ch(H1KCDZqhpOXO5lo2XNX&vB>f#XMXN>1tzJoq*& zbyUvVLH?zYF53d({=FY|;P*UyG{AJ1LfK%w=Aei>V!o3w!IP;yJ`m<~a0vb3#ka}= zeoX1FretaHPM&-Pk&(8z-Y5ck5eOU0>kZEls(66xBO$z?q?kPK#pU6No8O&AJ)?E= zrxJv+KRwIAw( zE*OYrh3BcDtnB>aNO;cb%Te2l_F-6zPQi`G3! z%g_^Q_g5w|17ytF9J6=0E^tU@S5Z z3*}3y&~;OBiJV?POLJIqoPmi3^h!;jIjQtj5c8wi6k4dM{-AkzOi*^S^}U*+PCL=I zp^C&1Fu!kgPt^_xiV3Y{2_x{qZ)-B*>}>n8`5%9$wQm#xj!0FzXUbGmcn%J{hl3i3dixGIPT|TrN!eFr?>0B0}U^RP^&yr~$Jd zSshWuSf4v~+#|x)Xv$aekr7KdqRsYvu%>xr4W2B(=U6kXUWS6G1^Y(4(4t#0e1sYT z3a{Z{4n;AFwNq295X-fJAwv`VEr%&GDtFr)Xj*S2vDG1awmAI57w&9X_wfX)$PX`y zv323V%-LjtZ^eU7;VH^gc=HV{aU+k*#z3BC2@;oamirSr(9F+FcK~{-iEJM2;(KhR zn}z&n0kF!d|Igl+$JbR~?xb7#&rXU;iu=9~$s?No0tw$x#Dp~vfk;12p1o#%Y#@2}&^-0G?NlQ!&{Q|aaq zwA0hgf$G$z+?G`56DpFb$eE@r3+aV(an;lr_se5qEtQ;}&Bons>Uxj+*~z+&^0x^c z$Tgkum~F5kOPL=>Dy>MKOiYJ`+|PL8jI@h-z_`J?21z+#+HeC4YrUYx9^gb9au_`8Vk31Ls(9_Hi_+; zKY7JNP+uSxRZLKY$(5kFUhFnhg0|gS2AC$7gXX%`bQi@<$UJHlzVRa+f4ufitcT@y zUWX3B^~tfZ3e*^R^WT4e1QIE0jpA3$baBkQMy93aFWQ#!wu{u*_y<8a_Yrm7AF$D? zva?_JQ{iA<-z(S)Z&B`aj0sKFBe+Q zd;Dp?h73PuUhM4ekEvCLs!;NfSNY^GfuITxq&Yr*{@r_lBHdBE)IPvj;18EB`~{Ex z`wuxkNDL9P0Qu)zK=Kf z6_4S>`!LZ_=xuMjmA?-Ye;I`8r7$^`m6ub;-)-J_|DBwE^E&8);Rs>~J|85$h?8u)I`E&vOT3t1^+0=$>R4sFP+H$_f>%f}4Ez!TMc!#-v@&Mj9PwDjHepx&pvieL ziC)*((8PFktj;TGY~!LvY=5ZnbQp=B`GDU>4e}u z+ct{VkBtg3T#F~Y!MBZ~_)F-NOtH>CxHD@0Z4^=H`)jam`+4bT{$|&zUS`*sCC==} z&F(nh#luhHA(0ieZIowbd(sbJZU6S<%@=;EE69iV9UX7?&6 z2fSti`WS*S+f#=5pz13mpu^jk1%u@=EU*o!>_d>8&~o_)e)?jV$ZtFULZ<}-V{mP- z8LA6GhYYxTuGM)lqn2|&^M;r6TOFR%1!-ZU!Njup@-UrgjW8p2P(Hi=}_KC z7~2D{8GvU^P$wT=2Cc#_m*2bb>p#IN1UvV2^)A6*{N<*nnsLCI-W9#8PK83iPkr%W zEUK^rFHNu2wqJdEA65&2M^Xcw%e$7WS=qIu`K|AN`_KI<2K;+bx&GGc|NU#fmu4{Z zU0;0o+fDq|N#_PHs7^6}ry;~?&Y6#7=1+|xl;t;KF<2Fj*wp7N)c+ok;k^%k8QwS{9S$L%&1h>*mlVj8D0)AE z>;VnE$R#CcCkelQbK7$9y|-K%62yL|B{CvF@dM}n=mvpeLcX$(qrdP>Ao>0|&K?5E zuulx<33kM5x%$exL+Bjm%*WpbI6U=@n|I?}+MnbS&MM%BJ~DU@@3lO6-;X;`3dA8b zP4R^kyGgE|pk5RJeBGz-@|&6RV^uPfDp|)P|j*D&b43rAy79;~(lu(2Dsm8TWB3*c`biZtKb;$h^yr&Y_ zOP^aRxP6^n*84ZCE$96GTcSFJfP9Iwhx}7Oh2P)yV=RR`uj3$6T;vinA?n~8vdU%38N94ETlS!lJHKuRkcNFqiu)Ah$ za-xpKF5xzQd^6+~`5(OX;m;qybpbz%@=LXKx4SQP=JyC-iyT(HFcoxj=xREVQuT83T#7tC??7jucV0!PT-QozD(#p604));c}Zrrc(`$a+#d-A9n5*mj+hyreO?XkUzoMCbVEXtf?r=Kzs_*p~mx zmdoD#zrP4sb>M^te+)F#UqA4fI+u33|4y)w&^`H`o4n-U22-NM?39Z|fE4VFC3*5oyhV@X$zL&di8}laeQq8pGeg!qe!q|%}e2I7p3w}DlKnbXL z#|g0mi%zp&?KIfPKe^=2KE9C;Adf8pKA$3LO?`Hb^cM{mviUcBg64+`hov zReFS#BW)hJJ7~u&1xX0G;f^-E;P8A10y9q;a(*cOyYK!1cg~YuaG3EBB9p}fyH@QT z!`f85#GNdTYfHS`AO`9qcU<;jtHX>bx)G+Kfx{LmW+l$v;}=2xrz z@SA^(H-qy!I!LW8T7h-p=b+j6*CMGzyl`9P>?K#?8(v16Zo2(D&^Z*Rrd!Qm0e!yZ zMWkmrk1T;TEhm(r{yTqh|7~3AL|xzhU`afN4>!hoWlUZ(1FT8C79B6W55LvRdGLb!Cph!bdW8@Jw10yTL(BKx zct0pGT$|p(eegw(_y8`>eQ&GfPhWfAVmt?yTPyZMp*y_P_FCS5)mM+?Ytc@CkbS(i zr`~<9eSvc@Tn5;Mo)@o|1H&@QuWIEVeA&|mho#NhHw(+oLmWGhi&TXvwaOsw)pHz2 zU`{+gJ|b3ZoIYH|M3}#ziv?G&Q0#OJ8lS@@%`kLH8iz_}EtlQ(hEUc3QJsb74&-Z# ziu*1`6Rai`0mM-JNtR_l+Sy%T71Vb#DP?~9#p_rj2cg-C`;;OqiWJ1BiJlt##J9fD zkc&%SrBUB)8vb7Q8}=3)P3R zs4F8*Z?N~FPuygs<>~7_{!*?=kia~n0!MRSn-9P&|9!-yr-%-Ca4`ah6dZfdT6*5d zczH;idtS@WpMDzdn6TIfT$S@bc$0&Jl?vFAEnm6)y_iDdC)b!I zvEC+-8SlNJDKbJJY^}gU+FfTjO*=15F9k1nA zZ@V6AsU&$oVuD6hIC$?Ixj#IAgQypL2RZw2Ib2sBfgCirw<%%r*(k{StrwmM8aXmqBLNoA0>vPfhGl=OE)Wr8T{NlT{dc_h&Bp zN0V$r$`Nu$Aq*#&6;Q@c0$hf+3@VY9t1r0|ZJ8u5PD~P2KjOp@^`w!n-8k{ z&t}!I_y6IKUlrCe9y7c%Yj`bQL%}fp;udEgo}*EU&glMoXVBeVdEH1QNQ1?eS70zy zYGZIEU7gr;6ch(UXj}e#=^euU2mc+PeDi~1 zRc`s?A5}~EmM1^>bCKJ`JG{CB&Vp{Bu*luxX^&c+`0l<_j)DvDPAC^IvKuj>GO~f7 z`4i?{@*Q>0@85l4ll#{u$gvcJf%e0D1iP|tO@H620ZgQX%JIuqu7V9J_Z(J;KkfA9 zKR)>53HChaIdaAl)_xx-h4vvd7=HYYhc|&+u%NH2tH0FKy$njpV@djV-1Oz&G+{nx zUw`*0P+h+HXFvV;y*w4u{{?Sqa>G|{xwQ$-@MihT{-vFzBaS`dnC9>O`~EF(hA)(V z;60E#yP&FkZ*N!U>gF&0>2Le6{hfXKyOzOnG0>m9<6q0&g0n+EFdq6}EeO!=U$s)S zn%fC;37{X=8-Dqwck_N&i;JBr*7P-h{+nOBuE{+Ul1q_`oDD6`Ucm&A&Dyy_GN9Sn z71(kll<7a^sOEE@c)$S%P5fq6@501`@OciaRaDz=soXzv+jrg@;vDvv4b8z_^Y~XT zyzbmDIA!t5UYwdTR-5^`oHV(W{4XvPzS>(Nml7>fYBcw`8m%Owc908vrmA0D}p>KAFM;W zDX8r<0VbdaigUh7PT*VhnO}W(grAsv8&{ltxE8`pD3F>u`qKQvmN%Vq*=zanxR^X1 zjVr3est^=HsrfnSLIeDCu5)PW@4+-_8LGiE2o54>7B0qI|9CC;{p`y?JK+d2L?QC` zD{gz}U*hkr&c0)lqYwB)d-bfq(ktxqRbl4}aXI zYK@mat4_51=ekcX<9x@c!s6#Ri%J205n6DAGWe^)o*R@#2>APl*qZJgbDU#RGdYUw zw#swRvYh8Ypmmj6%kRE-#ealEaN|55VNvadCdKn{UnAj&sA0|!U{Uvr(2+eXo7h4s z&aPf%WPNF*I<~Rpt(V^KcLbi@DB`2g{VI3|m+F3n3>fl#4zI9=;T6wj$W90C0&T9a z4^+#Qzdv8(-|}6jmEV@3J3TPV-IwH=v)qsAG}N4>3&#bRCRdx~&XCEg;{J*u-fwMq zNI5|K2I6FA!6qmSsg4(~<-)K1;zj&OIf@oCRUEG~+%sCy%7 z;-bwSco4i*R=^Z%ATvv=ENa^AFqYYnR#^c(LIqbF5YWVKRl(fESpt`M5YQU+TJHV& zU)uS0r7!V<$^NVSt6`@(zzl)|*a&RE*?kkJGl(ONL3vP6|6a?*zyB1Gp{3+Z=<~WB(S6U7ajEkF~f^B(Sbp*N$qE7`6g)lD@r>H<|XGhqU^-9Y--gNVk zfhiAX)Z~~4o}jnB3U5Sem9htC)Wv_fdJ!Lk=a{?R*-^}~C)~63F6n|cgz(e?U+rR~ z~9{@yJ|Hb_V&l#^rt5GbO=8M zu=I0Kbkz&NTnHZxK*zx)uu^e=t6taHue-N%RZri_uGL+o)oUOC1U=6?SAlYd0CDrb z{`}Y?epkfN=e}tiWA{P0LWZ#3mll5Sb&nm)iOo&HMNSJm5;v~4cwc8BRE#w(z#}!m zobCgVr5i;@6C#FjW1LFGnf&vi<*iSC`A*^6b6*c)u3|~(`yz+j{p(M>K@8z`&Z{D# zHLrtyXAlL-CbuFPq%&5CKFQ~et|9m+0^25(d8{moWFRsaw+In4m|d9|;j9Z^6kg~o zT>FVIRw^Wd1weC6<*8tpZ@-Rg0$Q`gv2Wm#Pk1r)hGUN zo%l0%$owWGC^N)rTrh(9`87azMt8({PJofOtisjBBy`~NZ$To~KHh@R=`6uas4ynI z*!{;<7;;e7TIif&$2q%g3ReWb;vWx)YSgLDk$kBKDBwH}DiaB=+|Ah)!1Fi$^qcGO zB&IrOWl*iCekQ$^pIm=Fj~MJKBs*^Z!@Y5JV@0_OSAFA>4WJ!%6t@^LmyKKg$<6_{ z;1?U5g9NWl(m?YKT)Znp%~Y>pGuuIEzBK};+IX$ylOOrudqlJ(c9qZFgcQn#yA6js z2N;!7;19H1^ou`!2Y0}Z%XuDCvU=h!1%%o7q!7-ye(R6!5Zi}mB^kVz-9RMZPGcb) zo#S;#fr(;z*AFg%$EkAqW^3MvWn{f~oC#&*GZZ%UAVxpTX~rN?rZ^tNNSIyZYLBc(Jsk3vQ!M=|(>c>x4Y{ z&M!XH1Xnuqp#O1k@yhN2r~uOZ*SFo;3dKZrT3YPJVj%Zia^vGj$K989_rp8V<;C75 z1Ivpmx|*MO{QYObb=RJ~UCUOj?iQ=zH*5O4ntyly6E|Z8k@>w{t503kzrqLOFZX_C z?OKEpdMe46I3B8KN=Q0>I5ebd_%#s59(Z65EXm4933^t;Tf+%>(J5-<^UNE5MQl7tu>iki z2b)h@?6>0YQr?48#P!9GA{$&wiQ}m?kUQ7{ChR=n!58IQmcjy@$K8X$aIH`|K@EPV=ed^>BlU z#xiI(Xvhn?erJBO0Xa+mzWSLJ{BU03%!3{u{vb$WKKFYA9M+eR%#2POtP!^E{Vu`6 z?snHXi?VzMC(Aq!N~l+%ECaacE!W<2$$W0fpdS#{$)Q2eg&5YT)|ZWpLyFcaC}gG; zsodAubzJ_g}QORRT{Dm z7?*~Q8vokG+4moR#`4|^EY)+yJ^EjRt>Ga~YmP&^05;gdJW zfWy1;mW$5$$d|=TJQVWJot+)90KT3x(z$90Mnd*>7Id!cD)z4FEBS`Tci-~uWe~w= zK^vtD%o`rI5Y|m;%>bPApa0Qs??R(&uh0lAUnc(g?(46)p^3fFIS?vctSAk1pV3uX zS?pg1i8QOhW+_4WjAdQ?*Uj%a_p;m2V%Vqaw7#zX?w+pR)sXWN%=G5B-S?d)Oyp7N zbH%>y(y7IMZZm!1b6W@C&UbH!tE^m7I;FUBO;-uSC;i<^x_X;$z2ow$(I$o{i?CNp zDU0ENfp+7szVeGEh%qe!OKvp>3MO7sI(f~i)x}cR zX`Nj_#QSgCx({@IUf9z;Fo4zI0S_Bv~yjc6K#i`ourGka+R&IQ7z15G`wd_@P^W(1dZO1I?o#uI3w^ z&7XhbYRpsLOAW+X`XT0pw(rNj{?wP6*uDQf0 zrpk-&U1-RD$f?!(21qm7+&8&yq&ip}f*cCCsj3Y1@f`EeBZhbbzWKcNi~Kzt3M~_S z5{R_RS!6cjHGlc);ep+p@YI(F(`8~I)ak=cJvxX>AR>ylBsn0&YbGDWAvueL@QLq# ztQE^$E^benJf@H=0PwT_`Q{O!hwtMLD%HKbF!*b~) z;uAYu(0$Ji&JO5af!VsSEUtecv2bu=vV=X5ZDK&D1zN_&c3C-D0YL)@NUauA_+nW+?wn)53M zc!J|iPVhX<(!^__RO+8Ed?8@G3%_1)kF-RtA?;@gR-?Y|)8{m?ot-)GKH$o|smLs* z#stKTy}9%+^N_bZ2#Y`PaBGVG)BIj9jE8&q9A_7l3}RQe$96UC6LSFrPUvZAoXgwi zdtvA)x)&k^(W8|Z<%Zi%p5qPP#U8P+cgy8Z{be;OUvXCU7%tN2$Cjp5!gp#JuTso` zdG})hK6;~%qnusVK|CLGx?A3M|MmBZ=m)L87mLBD&)~*jxaG1({fj3aMmgHq$*&jj z@dxg}s?zfkYPf`oLvW`F=i|Y6F-6BGc5<5WB@=dIX#uPaZb< z!022)OBc~eHjyv%>D-lDi_&;F@0&k==bYnMp&crhK|kn9`=%q>{f56@``P|aQ|;y9 zVYszGz1d!lA_jH4=fd4Oqw8zHUn2lX4Culckq_L>TZ{Yq;IzFKoKRfgrKI;?%Lud!CXpSVgg@2B~E4SUEHu9^;7dVMKu(h~b7)y@S z@$9(iAhqcFrU#1q`26*uDNj_r!{Aqs7B6br0ChUNLVNq>&6^{CZHKaf8|2c5LH^Xx z_}Ivnwv->($Bm3n4!u|&<{e+1@9bI>xgfAzprB23yU@=Pb@^74NGYR}0sNu*_ik5Y zf4r2vL{cHe{!l1Dh3K8oXod_m`aVbu@ZpdE)7K6v){GlsA1Ny0MzO6dmcF>RIT8T( zxEyu0c3RL7^T75HKfnf&$iU7JKTfev`}@6>lx*DZVzfkvR?GfCcZftsz|I;1JG27Z z3Cd`JtCheKF(86L8kW4VX>0KSGfyD@!EL!r=Xr&|0+Qajhl! zD;Y(X!tv?B)l~o1;sPB{&ZL*I{5UX3#oeK2d{c$Jh?Fb*a}KsV2yA(|4zAoPZ9>px zidw~kD%wz1yyh3$vN5gZF3-)hU`Ms%nuSBsfx>Q?1J84%amNlPiKWKmpx6UIu|kAm zk`|I=UZq~*1|=`Z%uCP8A(V{Q-QH=COU^#k4oeH$w&40iO8{n3E#dS#WrohOAMWPN z3knK*?91`fj5e(G(8_?eIRk7b2x*s?s^(2t~r;o#^CVl;C!RGKZg=d%dUA{gn*Tk3L(17q zbEhLOQfBU;B#L6D31^fT@a*HdsG+#d$_aD-zRm*wGGsAthvl)`<~X~dF0x1;n!MV}C4CF#NLpt7VC=3|>r3i3_ds;&X&_2Z7Zw+}c#dx@iJ|E$j zH)5T#c^n@0$}`sy=V$#g)*$YFv&q>FVC^oCihv}eP0H{vBW`p}O)?Cm@xE~6ef%jlQie##k6c%mDDQt$UOKKsP2U97HP-O0aUa_ zG-Q=2LkD5B@!XhM8u0;+V!1G3ZG9(jyz@A93a%YAcI6yrH=tD-6&D_6q@-2F-2!BMi6o=cPHn>E zfJaSO@x~{i-n)yd!J0d5H3&;6L<_EcT?R!_7?x$luPU|CDo-2t5{~!yU?ZjIqY)BIfA)N??gRG0Qx53*j-$kKM8Zp2~ zrZgu_BQ@Eg8P;U8;>TR?I=lPS9e_?H(C5@+w;LRpmy^0Q;_~Q|WjS^30U?%`pKa^> zW5%!ToYj@7xu<3lYKeQGJpF|;I5S`mMz72gsHVbuA>%?qA*n`}lhdgj2{x{X7#j9_ zfl#o~C%goO{Wx&Z=o?tgMe{$ENTk`OuM5TJBAlmulZq+<>z>gdDwuq=hkRd+4tNK?S_Jik7@sb?Zk6UeKiRuk!x;SuxVr&} zp)@?S24?hqwi=^@DkYjWyY=zB;iXv2{S>e{W+Qq+@a*W%EoDiGblN-fr z@c0B=g@deXvu{QH+yc2VfN;u$(rF=SXSD)1P>${@){_%`iDJal{bS(i(wa^4bR#mJ zMzg&&VS8I$fRkO@Es-9O^WpOfWTScp`CKAuPn%o`2NHcZtaF?DyV>u&%-FDpp|Uy7 zC`#xigjs??IylN*rxlt0K`@aEckNoT)?#*IJ~12#Ft}8C@H7{~9()eDyA|Z_aOn}O zix^Xpe_Q2nu%l5bI6*RhK>G2Wq`m>CGw#{ytdxo;&1T&SL{s^3dr=_vL9dZt&$JB4}0PD1W(~dC#4`s?Y4re`Aib2Ou7aA)SyU zd-~Y?a`&y7k-OKsr#DdSbYxSB9Q52Y1xRSa8si&!Ai+%3>=BYr0EzQPNX~Kxa?&xd zJo1G|-W7yMXcI*Xkwo@s8m-sZqhis_9~H9_DEZNj&aT)=S!9z#vP#s~r`-wNJy(;+ zlZj46kVEwerk5W(q;Qalq_j~7=DY+!0!#M^lq21Bq5C(UL4->NIpUqHXxU9#zL0{q z{cJVQ6uU{9v2?Z&+HevkWdI&bs&hFMKf?_DcpkVtXUh!u_L2a8<-yL5NCl65bq>_U z8XD^N-BNy?QiZ@^f{4dQ<5W^=(x{=wKtmrdEmkErZ9@nVCWtC4RonvrJh6DTIq~Ur z)~kUS-yk&&*X6;#C>08sKw_VaYYN)v*Ec$6h9n`qOL3U~p<9eNEl03+%bqK%cw{@L zI7a84#gii&g#*m!9R6Ss0wTdp!||Je<0|0GIlc}SgrZnr?bb^OM!<717V&Q-wK|;uA+*W7!VY+ zox!xgL+QW}hJ`(1YvO|(nX^ORev1fcR=g`)i+jY-HX~VRJ;ox@B#!I@epoXhM(Lk? zQkv-pjEJJU+5|U`*%erRFd_P?=ad$kS?!jcvhmm)@1sa zPux}3sBRLC44C~Gno=PS{GK(2H=TPyev=jXAAv;0&p2e-ICM0qjZZ@HeS<{#ho0O% zW@^Eu!HVpA5?3~oqj02@r!1hcPnsjRbmfD11UF1n`fR}OOqp%B1Bs8;HmxLE8-`S& zu(L|Mi|tiz!`5?|3UZOWxotlHW7p4Zqm2VGAWWY$%Kto|h)V3o9m6#k{|_G0{8%)L zRCh;iXCz|z&PoLK!}FazyZnC8P(^qd_^HtU%wzu>IHa_$6Ao$obLruwp**IoKS#=< zYHqSAXe~kID)qPaS+=r&^DQS0q1S%4{ADS$(iHot@5ItMV&D|g_|oB|_%~SVAQ5lA z(fV2AkwhEY4?xkZ6$9d6XJPG?z}kb8SR2|}=0`(kSPKZyJTB~S;;~wi-6Q=>Isl7~ zW1Ixa>!j}(;vaDzGXktp2Pz9QzW~fkyn7~0Q)>I#-_6swV=WJ% zlfzbWIJ=wxhJDF=^e!RIx%kmblQH{2d?ye!?*;1X(q`jU;_5w2Ks@pF>){l6=Cg8E zUG{vZc_}nW+gu(QQ6ZNvLj)PFRf?WBK3EklPvZN~&_Hc2-hmBBu_(=<^(gS|$n`!b z{u7F}$iKl#RUj#?b8+u;mWj&nwc+wu^|c(}$lL!-y4!;-e0V3ic7H?2btDPe&z8UO zA>lVHAv_Duj|?z^#;%{^?2H#w(2SVT2cSPr!>qHWN_ z^EruzxEJ=104I9(N?_0@bUH`CM8v^ff+rXZ%1^BGfmpjo;7LP{mF`Jl<0ua~1_K;J zFN*1m31JN8NA;|Hm=;^LU|bGN+1+U}vdxGk+;-?6xTnX_;}%|#O&k8-!EGqmrJ)_4 z@I+o8r~@hO0Xi33A0JxLg%sncpmO~BSnqTtaahOg{^%7B9d!p}RqC`3x=ejdNO*%<(|=v#k;8G72`h>QnS<(3H!Mcx9WKxn;w@^QR48h;J0 zqi97TT#E>R;t^e{!}pz_6Ws~u$~IOnRfpn7hjQ2LM{T$J;!MI>Xo;Y%4tBi%OjA-( zLmMt+ih#t5IOQ_w6f7U=#sH8FeE&}=6cfGy^+LSz|Ih~ifT4kg> zI}R_@FrCD&yhCTd@Raxb$YMIl3!}(J{;f7a8r;w9nC^L(unBJhpO_=ewGr*ut1z8VIBx3?gF(LjoL-s<*%@)_vA#ITG&^k6YKk+c=7qu4B2+x52S}PBE z#9ee4V>IXmZd_{Um{>3`TGb1)X52d#ln4OLP2(-%_sktpF;>d0eZl2zex?0|_;9&MEd0 z-!G+YLvRix-Vy~m6-thD*Mwe!%GLNbv)4>d0vD@j`u7Sn-F4$%0-c8LP;zWvd6^)g z4p|=N3xp-EEk`$sQDKkRqbc*_+3&ZQJY{@$22y9i5(E{koUl}pox26N#|!1-9?Q>cUD5}m+t}1w#RFm z%Qb99fi{E3rcsI`GL_^89c9)(h$P}?zeWos;zN%e4J&-GE)D}mhb;WlLiA`NPZW*V+u z16*DEf@HRaPbedQ&$K3!+V~6putFhnSMhmyaMAGresHPpxxh#o&~}F|8vGE0IH{?8 zek8n|Lwp&u0Z$p_(9n=rq~YYfz)6)5CFmX9pV5C?89Un1c)3ns^=Gtn06O%c(gAcH zW}((MfLiKBzfUb`1Wcon{%hUU)7Eqn3@tA}fXJOpDlgzpLA}-G+AwteNu-__lb?DI z0rieaRvK-Pp9*k*h#Be{_M1+Lv#eze1rf5G64;VJAY0g%1ZY;QldsNmc3;M?(cv~4 zSnh#!^3~uRr^*6q8&ebqehk~|nI!QsxHS<&VH zSm5j}h^-%~9>cy?zGp^K2qbE)D3E#3!8 ztJM5gsC&clQ6HH~-k5KbZf$ZmT0#`VqM47sv`)-hJ1zFg03G6@>^)vF#VJjjGE@*f#gg!o$bsSlpt1v0N^u4I*D|gB&#@t>$h0To2LNQx;mrn27 zu<>j{LZY6=9(zCR+u$x^%&1qb;g(mrFPnyXEF5527Gr!O$MyvB=n3p<6GfDDO~*(~ zpYaQho=Ax10xTDK9QTf6ISR}d>o$q zi&tjsks$0s-_M6l1_h9Woer-NpLrAGP@c|(D@0YPOaa8j>iAY$DLUUYP@h3KUHv@8 z?()wN`eBPYLt@yZ(Vl0TAit!yNdV8L2mFVm)}wE-anDkcM0fa8sN(1D;)s6hV27vM z%8Je&`z(NZYPnix^eq7XIRdJbn>3Vug^ALf%$=^S1Ztv;v~LE$W<{kuw4;;wQiXjt z*pc*83vFwKa%&ZnC6(#pAjK5^PK9{Wu8QrP`Y&yLNmyE9iKc3_zA>SYCpYeBbs22T zB&5=a&PidQ<>q`T%LTW(6QZrN(4I6wu8!xl`?EtnkvWvDeL+fE&x$-hGSAsx?C`$H zbx?;2#cCMpiVXF^eRlOMxU0P=@JiE3qj@4J(P^0fE-+wJftLvmS7}HB2Jr-hjB-p* zZ%x_vO3WL>7jm`C3r?}W`|?j4v`YSyX+S4J8ozVTO+gR7u}^0+hCBqDrISO8LD(ulzgfc6Vz^oZb!)y*lpFAwiOIxZ*{h{;3YK-FKNxp;=vzMBQwh%_RXA-ghDYo3xKPqn>mqavJIb;zLmtlt-mlEZ z=CQ!Sq9X&ikL#5XJQDacipSep+)L^mv2BgRu!0|R!BQsgwOT#<*C&%%-S z0Y_R*9BDI>j@mzGbWDH$P~18X>=wTcAuX0-z$_DC(TovcR!*S{<~q&Yqvhes((-6^ zWXmbl%4Uy!B~5H6@|6@wdhqD;RAaGq5sR-f^14q~YX{ueT!CH-A z0Pi#STvOXiPm_P{32GUU@G!6@?-%KW6>)I#FC^j99GRu9#rcxtoMzNsKdSY}bgG!o z0({~BpTc6}yDq7K?*|38DhbUv)R@dDTnEbRPz{H+A%DT@_!!n9u216ivn((g3oUc` zdPUkaNgY3EKI`LF*iZgwSe0GvZyuEnE1|u8eA?ixPkZsH+S2R`(PBmPiGfsxruX9zGTEYmZhc@6 zJEd7lnG_~Y@}*2GG~$m5YbM`F@u3gZRU8gMgVw$@#OQ4<3^5JzG~0Y4)Y*!IVcieM zyKPzadtre-Eqk|guIVbmXfSb1l$}MR!pCt7>-dO;br{P8D1#T&{!1qsGHzS(C9~+# z{|ObF<8?5k@ zfu8ah7=yKb-ps_;O1$6QPMtVrge@cO1u?)nTNYLKNSJ@zRImEL`rQLY1-RHCKGb~0 zT;2VGCWw?<4jbLLHxLFbP9q5Tb{k=kG~-Go1k+UepdcV5i%2t@rloIY8vxKalZBRF zX(TOQ*ZSJoqa?d;j);ZPrJm9LN=rOC)@hx>)rvl+7f^1{y^hT$4bPdY%s^TUfdJ5H z&`O3ZV)#bL`R$hmZW6_+#%+cNeP~yybKkt>uWYjBFg0$+7Y@q?GW!_3@?q2`!<0U6YKQeS9Y5Ah2qSfB&aS4aVR?rBWzmT7Xm&l^!-w%>`#qabQ=?b#@nRa3!@pMoVU7r2Hf=gRTVzy<$2H5`AzpYmN^# zxv!o<9to%{3m}IA?*W>Ya#%8e1M$X!`t!K;}Nx7KnXeNni zWTfQ8tcmFmzv$oA#8f~fiIX6vR`A*VbDb7JbO?aR89T?v)>nr;wvyEQ)F*O=ybQYo z^vck5^oox$lN(6my8aB zC-ywQgN}}oKCMtR^rI*fPu(|WG4a=~WizQ_E(?+eX;lkYkiKYoRf`e9wiNPdk+UId z4ApM`77j2AjaoX$9HbxcQx2jsQ|aKmNi1+We7mt*m_*#m>$D~T*)e7}%yArCqN`RL zuXzde$%8>AC>3&a#YnVgriQp6)QK%%E}^2?+Bw|3R6E#tunjJl0Jrbi^$> zTz(f;=8ASFky9BzGtIB4cy$&kzQ!G&VJb%Hz#f4%?}$KLb0@e)<`0a-k*?A5>@{XYlWa=Sr0=}dt0MOkV7v|Hr?gj^z*iPtL6S&S8sF zxp0D6no=XfZk&s~HzJ-V>mpS_Z0vN|b_1|YmC?XcnAi!#uQ9x0b%)I?ySd37nL*7X z;gSUM3NNFWC5I|2J03J*mw=fG$`!5;5+Fd+H2!(F zx-vR3g87Z~MUP>${5mh2J__n(-E>X`56To)<&j&ZFPfnEl90QLR9aeuM@nDzFbrt{{M2)Dv@$nIlEhY~GeV~LTFRQKrR!u9a zi>&hN15Y62DY^;aEKu~c#kvH1F>GI|(;LX~#)7nP}kJ?FT zd2_=I^F||5;TW|+qMOG8JiBzRGk>5yJ|XGsG5U3(Hcoz!chg)Bj5%|9d>Nm}%$5%{ zxf^Cuv4tsFIGW~4BIx{rdtlO=fTC=Y%t;sA(V_C2ysVk_1-B<)&&-_}zTo!3lH^Ia z;I<>cZve!dZ``{{xB;L(kwE3;*|cu}#HDXuFLH)&00eMxLen<@Y0;UL)Rw3Aau#R| z_t=jhy}LLR+U|6CCp=7>C5x-{2MF(+l%ReiUMu8$3=L)8&lfkjr{&hRv7ApR@)#me zH1Ep>A^S!=Bjq^KK-3dQG%Bl5E?rDW8?R60LJbw|$#sDpV<8chgQC^W*dNyd_2#`Lg;BK4Qx zNf6CFfHHdjCQ(ZhTf~c&=O=K_;s>sA3;EetSXh*E3*(ALk(jHUugmXOc^J6Yl8(Fpa_UmI6O*e8<4YNaz40& zvrzI0m{+fk4SNHX+NP>d$2_6(k zC#^~Oy3k6&B7ujWU&QjMVzj0cJ`1I zl_6Y@Jsvl)>9TCPT^yTCGKkL1ihiO`=w`1rY%sI~+5*~dP;J0i{!_Ef4QIdPr8i|TR6fL9@>+3>b3vp%}?4FleUN9Nqa=` zNs*@`3e@ZNPXYn+zHWc5yC$dfhpQ!QKM&pCQgwEflIpQffJXh4Ld$rqV;iJ)<3q`hg zFf&Yv!aimI*iYv;djc)`{oo0&Zc~NAQFPeBFgg$Qeht)HYNlS*-%TRuDi0)Z%AoQN zzy{PylV$M6CTqXqRAh{jCUD8p!pH85TduU>sT-P-wCXHrC)JW1s!!l{MNX4QMQxu2 zAUyt0AUngu(2W=?LaVTf$DrehBl<=ysd^g|N<0OFBtTg<)y*IlZDz3$O_;zt9|8a@ zTd3mZ3a08?h&O#gY+?8CpQCHDYk(+=Cr35{reOFa5G5FthbUN)K%J`GLtF=oVpIrL zRly-e67>V6UQW!XUT{%?Y2lD`0I;tIehpnlN54bJA}tVC-`glGX3Q72=EPjp2bp45 zg0&z34(r#1U{-u^9uc@6MBt@HRQ01Je)O10vBn+9Cj$AGW#mZDxGtQuqErR4mk5c) z<(t#vGbz&(!klCqaOYwzL4vP=HSAqcqMgMvhhAP;P=suq@W*N$yK? z;a%7xwg9_H-t5x>wQw9x`Ai3sI~EASi{$XQ8=ilO*d z^YT>88b*0rlWXgxVn3?{3{e^tUXlY!_D#5xg_$aKMr#57_dFEcoK38jyGt9emk<}Y z6vKCH@MtTc(770p2d}fT;nnRfYXn}1&AaC~3kM+8d`Y!DJT~sttApJb6s=88)Dvn2 z5MM-5r)vdRC-7Yjk}%v(J0o9)sTM}^2;`x<{oZir!ovel_Pwt*UPnJ{d@RBJGLDZD zCCzbuQA~f3F296PutH?pq5{&`(O!DA|(8J2V|tDJh-7c26c=@ifq#Lj$w2j8m7A50d(Lc zCI?M<5zp%N4ge4(P562z9emh34 zv;VPP!KV_^5Ge{T(j_$!C4`dP_`qdqndX?_8u=}IME)v?mx#AFHIuOnb7 zW$ePH#+;fura=n0(1@cp;MfP|I6H$BVX`fwZ&m#fc?gLK0>`EyBqklFB;L5Yyb(f& zNEe=`?@S{U4C=Ve2O11OH^iaI5lHM!2%Bo-@=)wUKrz*i2{ny6aN9fufMr`&+}=h| zC_uQdr(tdOU9mL>Dua_X2s`q`i7m-nQy-g$K0gEcEJ-6#o)4Dr_Tw#8%o+{4DKx~M z)e#Ne(utjEgDoH}Pauc;#qr6px{b8qu`^6szElYkY7nlJ`?hhU4I>&SZ8B`^!nux% zyEGa+2bX*}B*t_dIs3tpNcLPPuH4xkCFr`I@p5B;K27xck*Vbcio#V6&R7WSV z=1nMK+_ed=Z&*S+hxjB9Z7v4dWCV0oJkhMwq!%>q(*2)0WG`7oOn)`OQsXgCC1qk&OZfPjW5afO!$c!YskLDI3$%m=-N#0f@Ob;^W{Z`0%7Zib82MAtl zS;FJ|3F$J1(Rm1nT_1^Shamw8+&u6r2e~!Oe%g4)>S=3NK`)H}g@ptZ>>F^L3mWu_ zmks<54<9xp9Ovc_^3V-i1}@fgl;nFn9WeeI%O0KVnEw5?AZC;{g+;MN$@3gR zp{O(Fzg?kQP9=SohrEvgdG#YekvHzsh`tR953_)t*VOTf21%%yI)#I*kj=`=<@5J+ zngt8$17qb0Of&TGZhwLPC?jFl=mVp3$#b4gC5n8ZPluhqwfaEzY9+D9AR)w_46^&_ zTuO1H8v#q=k>)xMvw`fSa2zeL!2|6Grn-tyGr_?^OX9CC{4 z;C##3B6+}2(?PyuriB(zQi+mkPKj6=p~d!3ha?KEMTMU3=BVkQK=lgyR=EcmNUvIt zeNLuP(s>0z8f7r0M4xspBZ9z_DjQdqBY=e67|oEN1r?%f(-u^Ge>I&%iL>&&L=4ak zi?SC&Cq=#lv?C35GCzh63&_NR2n!|8(}+B}2R15Y%9xmRPtI;ckYw`{CxRRk0v7h5 z*)69l*HUh|0!30WyLbLMps8+}Nv+nF&O3j-o1+zm0$kIgxt#P_vBEyzjOBAL^510VB;cvo~kbOfxgK@M>2!CZ{Vu zNDIw0g+wlm0>B0d>db=|#1J!raBDDYNxY&(K0v9Nem+1oD)IQCKiFz(kRayef{6=E z!4u_Rg%G3Bd<*^%T6&7T!EZHACmEu36Z$%sR+59hvoU|?UYedZf)MOkAOvJUNK=TG z4rvMn#Eg?8jdWn}qg`4=$%>LQE74Y^yYvXd^?IOC}1bM;vsu zBeTSC;|U&tF3?HFg`=C<(zDZ|&mL19pJ?p-3TGzt&57h4!Qz*f> zu&HC__e~0!c}TOn=m)W2oeI0eECgA|i)n#{2ziyUAmo8(^b%$dMbYz`TadgV2k)b>Q{~rmhlqPWANTGO<&LWr;?xa%N5gt?%AP$Ks5wWX~YMK zYX$prU{&=i4jI3!4t}j>o?>5+>W@Ayqv}slO5#f=YMb!osxNziy(H`wUElOTai78Q zQFs@E|}nbvUe6DG!a0jcjR4`GI}h z$oS;Yi)997$4xsr`-Mq@Z^h~rMNiC+<&sC+ni11QpFr{>-C?AE>%JWnjH>pmi6K7k zf`+)7G_GT>vN&%Be(5VlWiqnN6#JGGO985W_+rp^5rs zg^!6Od~0b;0XY7*r(!5E8&WR%=7Yf6}j>4Yz22V+)zq1$$J zc3TN`wcuK;b9@NuAKl|0h;(fVP<){;B!iw$UO|KgWAQ7c9HHnVE(@hIhbmk-+5@9L zz5Opa!0l&;=b2)kG6(r-r5+FRhX9t?We@P<8{EA0UMH<}LXCuwBA+wuZhNs#|Gt~E zi_apDeLl!kpnY#)nEKyHmZmxNDqD-YOYQ258KpuCt+s|tI?uqY@n@W3AN2Pe-J>Sh za}xXmZTrpbj|0!QnZ0!s4e6Joi3GI62_UQc*$C;a2?S-T0Qz!ftIH9CJ=hh)A&4+N zUxvtO!4Wo71o||B16kEA5y7zq^j$vMH$FznGNLIU zN8(rg(#StCa-(%P%LqApd-R^4mZR`JzYmSv16Dc0XNQRvK~fcj5o-;Y1Xc|8~AJAABz?y3jpZ9tML6$`7Uu zjf6jxTuP};)U&2hzpO$PSEml6uGY?Us>Gj7pwfP}Hu)4Dt~@B27#uMnMF&U1qus$! zo|v{YKc~7_Ly&kRdSubbGT|dD45;LlRo|?q&MkWnK!11mWRMIY4llT;kcXGe;Wy!t zM&_`Pkg5x)F-M&?l=Sta_4qYp3;UQ?N$c{55mg5p?ed3*PtWDouwa)*Pc~ZI!Y5l8 zoYdm>(dis-ud$X(wuxlsGwv?)8An&ti=S~OI%PlTu$xI<=WLTTdCf+*?dP;Re{|K~RYX=|ph;}f7#jE*Qhg_7hhM(MV3QJ@hPz(}?!G)C#c>)NG@2qixKT!iZ?e8$O+f{tYD<;^pqpN$l-2`b z4~C?oRS$d-NSG$UF)3JgPLuULL@H_pxaJsfWA#4m-2}T)bq2YdS#^P_T%}yVZO7U&yB93;fgGL1|2f+8NY{h zo}$KIH_2$-QcIXtDjxbt68*8hhMp&X@5{+T7LbLc=r?(KH$s zJ7=oSalRyv`KMR~cmtbKlYICm(8I@-F?;we(%Y`_5S?-GHS!X9$=lunwTl0@{) z2>q>#RZuh0j2m2|>{%tyoq+*HOOj@Q8TcT{ltz-i1XOt`aaJ28$$CalT7zg=M5=H| zqDU!d*q@YXa{{S!!lunM>2~3qt;K;XbW`R|KB`{U)bVTzVp_7#N`lVg3!S~?MjsoR z7>BgDWwr6i36K3Eegx6BhJHF2CzLyhPM$P;#L>H5@xSo*$d*>>~mb zk@Y=Bm$Ni~5Sf4zQlgzkf!qii;T3Wt@Sxt9JcxXlOT);VK>oE~Ltj}Q(15aZf|K#e zTjq)vw=}u0v5--VviVSTX@m?NSQ=E&7nVa6A&yr#){I;VEEx2_kVXO>AJ&b8Fsxa4 zf(04$f|zEo&6Hicw$&D6muIP=qt;w!{DngtD*|lQ9 z{_4m5=%7##_tSQmlv+BQCITksp^Ig3(g<+cnAmjW6^eq(m>9ipb(1XbzP%}Iq9*84 zW%Zah@Q_=awq`6GFlJQaYH9YcjEvFwIHAaxCKW0;MyG(A#Dd4iPBY!O*wbX~62R`9 z>+EHK*kiO8YZ`8XTp_%ev`vklndW!j4kzxJ(>ZZRAYhrGv-qaEsmUFmwh+`5PY$Fk3a^6rLX$V1x_vEO!QC z^-qpe82!}EA2Dq@Vy6%lafrYdqhk$VvJ&t$Y2OCO)shK_bSUgE$Ew2nVMrJ}FmyUc zplJsV_7a-=1%swdI5djX7*6_3`)(>b z)+e>v8pou@nn8zf9M0(TUj$fi@J`oKg< zrt_C{WJ3$PP?tOrZ~F~@YJTEV+0fGL2hkgT`kn!Zpk8kzlE8YqSEX`d`&h5#)F%-Q zj(WgQ!HMr+cLu;My4@d$z|VA;;1k5d3BJXR57j2tTy9~gqhabefwOnOTVako7jil=SdB^C#c3>E zOg?C=h2~j%Z4shjFmWf!^}!8D3!9Dh4(M8jB~Uh1!U~^u3S(oZO-QUFLmh0C#kO{> zHESb1t+0xWjy@W$0#Pnb^j%pnXxe0$ZNpVif#Z8aG?9ls?hT1NX1!xQ?osLFesWj0 zw)i8(AutK_#2xWLV&cx1%!xb8NE?8RsF-P%J*09w5Haujge}&Z#3^XF{UqvqaR+C2 zf7ABW#@AQTLw(41W9W!0*ns*+(kMvqU-S=LuxpjN8}nm%aM&UQ+<&oW_xpVCKbFu3 zaYTQ%sleW$b3sD(j+{uMMCUK-75l(5Ls$3ZAh~SuJJBDjE_#i2llajpDH5(+3h34qg>?-NaCf986F;ea; z{R+(=$^F*cr5Yr_?AJ}s9ypb+9Qwzh(59Erv^O?33OId;b)7Z1p*%KRk&0KW#qk&- zglr`{DbukO7P65TRzGiYcI2*QLZe0gcOR!L+8!MP6-Du>E495<&Q^A$tS%$j7HBww z#C;rEe+!pKo^Z5{ppDCcHs)L&1D4FIL1{^J<^M7L34ONA=UgpqX^uEK+QpLcsC%It zVFQK1b1*glO+^PctRC;2^y=fIJy5tRVI#x`=OEu%ak-~-QI9njl{{P8y*OehB%&di zT}ZTXIj~F?l1bhHFuRa+q^uPrMIhKSe$&CYkXS&Ol?>6}9_To|Ac{Pj$Ya2_UBE2G z-+0NED<7i1%%aO4hE1(Ej2wgIWbUK-Q5doKr?iQVo2*r2^xPJhTA&TQQ_FH&7V+{R zvse8#2^jXpcrGn{2d1aI;z9xjNkQ7*S7Y@l+@%p`>nL`lY74qKor4boC`TYOx(>+gXw z%k7l$uyZ>CR~ikV19C+pgr>cFag%#WBZS3=AVi+R;bTgHq=OJI!u5CNv_99ar=n74 z)#q64$=1JcVjOB|Zi$hRD~p=-R*Dq1K;vt-QbDgmVqNxKsA>;bqadxWjA9#+3ZpI3 z$jDsc_e-GC(lp`+n23X;?gJL1n%NeF=i~#85I$HxOqRl7Vac-t$1a@fv=6)EvaE@GbxY3-|05!+u?+w2ttH6_*GlcLQNDZT+^r`kONf5>DH?R+^Z z1-$HY=6hFK(HibuqsoBxz3^ku)UiSdp9Z-Eo1OV6 z^HME&>}zr7ndYJH`Dzo%!;&_t!o&56-0p}AeJnfLqHH2Abbt?5*A#vvqZ2#>M^k<% z!B2D6V|C5vNTHK84R9MtoeDv|ep3~oRjoE_FaF>>%q-vNlgmuuor=B2Ynbj5O}fTw zc(e;`eG(DnC+sTLV60*d&*`%>>MKUsX*DmPtGjZ4eOAhS&5=8mt+7a=jb(DWh~M~+ zAP1C|)4*?xB9=x@-wSejaFU$DDdde$)&{W@u~A@8bzeR$>2;c z7>qQ9P$AqUlCp-O>n4jI{*1o4jt@2wF1xYt1)$_Kt13aIsxzmxBf<@4>R{9$DFeHv za1j0ueMD*L#0Wu0{)?wS!YfaH_<4%mB$X%q zR$VDi{8)l-IrL#DSDGtLF*kb#SyYOOYonPa?hVzf>e zt+jMHjm{-`kW|f3TV0>d1*T|y=#OIsiyjJz{X`V8KLr7-DOf8-0UH%~Vkn~T}BQDh%h&yHwBcvL?ER~CL^C4i`P6s2ri^cRZM6oV%^ zW?~;F@%&M$yYz|NGmm`^ zY|bTBue@%ga@xe$@^P=uXx*j{^ykR37ohu^JZ(X+mzg>kx4SR4uw_UG_hyjG0I+`F z^G--Xix19$3D)0K*C)QVhWrNsTIsBbF|~u?hv+So8S_E+h}4)%Gz*7iTN?ue^Sj2v z?4~uJHZBK^LS^qLZXf2hS#XAn#*l16oz*=QSds_{cR;bRInekxuv)!HP~;YH<>PeO zJv=Se634=eGp)=n^bIn);yxN=LJP1Kq=e{mTul1KD$v5nJ~aI z6%5J@)ypDKy@(x}3>9Y5ONbx?2s>rNKP9O>Mtj|nkv^!(u%S;fIWjVVn4sI_x2b_;^dS)A(E1iNf`fZ37j*vBdMU)9UpuckK%- zsN;MHe_;_lJ^LFl8nFNmqt25r=qsV{up9{EtK~x^!c~8{Y)JQ5*^M|$R0_{cUWI)K z^gcvd4 z`T6zPOC76_W8zAj9Z#2r*BV!|;8;9Q9&rg2M$5VkKau2@V;x!-w2; zmXpwbjUy(GBMh-eVo7-4An9;nP-mI$(&9&9&4kTD5R}&31Ua+y^cf=v8Vo!rOPACE zYt$kVv_WP5(7hlHIk-i5CYwRr-yOtiX&Hdi5jK<=5p_A0#zOoMAbqGj?2H z_~{8l;UMeUK|3q@5JXF#Ad2#IXxr2LCHEfsB97XLY?=tOuc!bnjgAQ5PJg3+ADFz@ z#^g3D2Pob6KOHl-9nuH}9wnz%>l=n@<;@94i5y~PbEaLh?H(oY@RQSFRu25znX^z( z7tg3+NXQM&d&t6z-kf&Pr~dFT-16Y}!H$kiDUZ5@{lm9TOf>?+wbGU*Qlli zz___KY}_PV5c}u8nPw8dG-~`7*x}0W6&GZ3KMzS(1Qt%eDHUd1g_tNyF z;ik_Zdlu*b^?GF60$Mo2CJ;r9G+XBmpg_Ak9FwKLF>u5Us|26P`Svvkx zDpm0WEF_~`T-ekx^V=qc$l$po&7g#IOF6_S0ZP@R*<9PpxiqV0(^K=X*ynI{e5^QG zANK~!Bb6HO2PRKQIz>#JkkOB`SPrib#XH6JY%41$D0#LQDHl^gmZJCpPJT5h{4)5* z6h1fMhaT;h!J$WC_&nN#RO`7TNhtDD&0d^5JwDJ%R32V5-^AfXVU=cQ;eD36+7Zx& z7-!W;{qD=Mo>T$TyuzNrKh#oKKyC*-9}@B~@Xt}Km1j;TuSP%Nr_gHiDfDtS9n9D> z>bW$XO~Ox}C`?&4-E^7PF&z}m%tNsib$=Kwwqn3+V!o*1n9qu*e9wN)-hzyaF%x%e zNOdBHc4boS)6vhc+Sez@B86`S74qDO<+DzJW9z*;(0X!K_2JJf5p6#^veXp&nST-_ zCNY?(CXr64_Nr6KeXSL9el85K89?(vD2fh8+VVZ*V8oK{ z1HktalliWCi>n$U>npViT-7LT&*_ur@rzXsFvmqeS~#fYC&iIqu-`??$k6x1Kv4Bg zDT$`m2Uy{rA2n{cDSC0T*n576uR`Wgj4BfI$Roiw1+Foz9>UgzE(UU^q_Hrr0Wn$o zf@C>S;y_u7XS%kAu{Kf^T723_out-eUy%j}9WV(D4xJFn=%Anb=pS&C0~+`(&gSTDL#fcB)7A73g6Z5rGjjHloHpdzM*_rxymgvq zA@fQHHjDIP9)qd_ARug8ryp+7e=EVFgn6{1@y9`ec;6mnR#=R>Djv{j-9EG2|*YH|k~ZhIk>bs`j8JBW>FUYSH}Iw=)j zXoOzL_RBK&rY9>>lu|ygIIqcl#kA=w*UVW7gu&AQ>5b9HeApY?#uVkEXH!wmiU;?{ zU1iV?^ZKgwQK;c#teujO+oaucij5GOOsX9EC=UilE;X}vdk9@>4(j-%4bBC?NWkgf zTrk!YoC^Tp$4QRhTrdNe*ug)hSmxkd0I9?(jp=NP?*w32?Tj43xnOn(&ISKaO9k~c z=&%;rf}|8C_|^f9a0a(=ak&5wkG(z6i0R@}0aRHyhxt(Q!HRG1v;|;uc3EFU$kKX*EJV-wW ze->rNr8y_8bpQ``f9z?b03uRe_o60igXbD|H$rNFuiJh${*Tu_kJ6^_67dN>+Dr`~ zy9$~hEuI|ND1t)?HMfI7`N;YSAnOs4ExQgDE>(HbDu-HWPxS+(M%QPr2O#K&OA1^I zu6=pTM_%Lm*+Ir)e_f=uOHhoZ)iGGTp8x+czNVbc(3DIjd zA?#I|%&@a(<~aL^=0MToCgJ6s`GbCbpk?LOpFkg;WY7irY3z3x%6}lg)n2yPOd)w7 z3kae_DjX%g^3UYdV6yjtUjvg>Ut3}HE)WCq(e-mcSJkme0Ld-rC|wZ**c$1~nvK@Z zgf=4La)swdh-QQVNu*a6r*&XF4jvXms}96mQ1$rHre$T3q9M)&l+% zY2->dV%{HxJ7vIqWqDm?B&m&o8q=R^k7D(jH1rwaaHN)|3D?&3EfvWG_Szi*0SJ2v zU)a{mwR+LpGB(&>nSe)%{C#G^&6{z2J~}=PbnLe3I(RH!tCz|MA&^pmn3}9_ZnCy6 zr|60Y8Hk~YLWP%#k9z8(I+b1`CM=p>Cy@|%3L!0V|_gYdxj?jzlxabvl3JN&OB#dA!Z`$sdGbRaHC9< zV;6&cC_LE8vWN0V0sP&(b)Outmjpwz?J9W%H;ECMns%Kb~b zIV`5!J)-5NKul_VI*6|h&>JIqeC z8kS%c8kY{p7&Wd^wR8dP5NElHU1Qd;Il}8<#Mpb3YNb&ytJW<1!;W>)8?i7&bzN#R zd51b0DZ~_SFAwr9XxR?i{UMIcB5f8u3$&S)gXH#Q&VJ$`0foY=C~{A^r#uE##^AZ= zJ#(Gr;=1zKP*6J0V<(X@h3HUv>MYFs6!gIxjwq_Ctim{48=stjMsgfr8BI0+6>i-H zDtKqikxhT&etVNUp7rdKt7s%`KU@CVkBRu8!<~GD&V{0|;}o>|2WhZj56pEI7AGb~ zwun9Dtsd`|sI!x4Hk!X^3^(rtZVonvn+RrUasmoDX2_kmv&r2w)0{NZukdmkLlY5V zpPK9JE^-6{CU%odjErmy^F9g8Ti+1oi8KKv+v#`W$D7=-8RnmWO%b_pqJ?i(Trdwr zTITd~i?C%b7Z2->EIQMa2U0caOv+e)Rcq#c0CIsa&|tO8U+em7ip#UWSz_xkTAm{# zw>5bl;#GyVO?eiuDI#0t*@_GM7PQ9|41xC&a^lYMvGvtqkM)x}iTb25%)GZjb^@=C zQ?DpqmIgUu;Gw)mc`4Mcxx2~TJj2>aa3@Z8i@lHrD|UfjD~b*YDVJJuJ-peahN3f} zOkcTg15YNJv{p4LEADTPzD;ywyt?O+C0Q<3Y)al14fuj!8iu)H*UT9yCCNFp3UukyWb7XHzWHlPFJ0ZOl z7wW=ZZC=82zhDpzu?kQuB^6}C$Ke&ciE$7<_wsD}W+SW4uxc6!NCmy=_d<|`D>)?D z@3B=R@}}Vl1d+l+n+ypb<5~))e)-Vv1K9{V>3YusL1PsBF(lO?{P80o!KX8SkU$|x z-W4Rj5 zRZ>q8N|~}t&TZKQ*4B7;tJh96!V;gzwDPQs%6F zq{*F_VI3u5l3Kot2U<{)h!@`e&LRyzj>MdK@gT(NsxT1tE95)?Y*eB;Y z3xFZ3%Qbk=(>Fd2Dd)?RI2Rh&7^dCcAY(vu6@n~hzyp%{0g=><`&g4ZI`fPRQO;rm zq(Fsz0{I5mDtSocn>Mg9eET@?tHXl>K75oPTj6*s#}e`2SMdXr-UO8O40uLg z#YcxWhHZ_ziuVL6IXL$$T*dpqDLPw1>!2mA*zhY8aSI>!#1gJds81Th&xT!@h+BBY z&28+;L_im(yM?cQZb2eevy!&+WyjgeAOIe|e&(6%bl#cy{zk@34k6C~xfghd%iX-S zxPPMd<`*?5v&>I+q$20b#O{u#f_7cUkdR{R(L@}HBb|wD_zEX;Pc`2%*xPm0qD44# z^w=BV5Dte*JyuLaOELj&60l~X{HGw6#E&lRX8KB7-hBqV_0@@tHK$nlZHXm%@ne|F z!+UZR!IM)G0>P_*N;-Jzy|nyFL`kjCvGdRxs?>YSqtILmT6=m4(GhK&fuxcTX#&3& zgBi3Y7rnv%Dvcqy;9&r~sXdJM&HxVpmVk1FqlMH5T5}jfY{HXBf_PRm=`VM27V12d zVFQny6C~}>kNZSQgL#T9lJHL0d8%!upkQzVECT?Pzkh1$n!L8GLN}DBBbS?EPx|Kx zT~;@Cp2!I$@`sWdO>SHHg?mmK8gNZ=Dw`pMq06sKzNdK(fX8nBB@zfV=885Z=@&o z4ww$&hpBdnnVjC66-9G9k1K~yZI69KFP=r4G|}Q&a_3|bHmun3(ulByD_BV~DS1;r zP+DiqU6NPuy!KEbtwYj*F)M7lmSF*#fNgbI$ID~?3|?E&8zX)^s2Q>_4@-X@5MiER zSiK|*Y*B1l)B69b`}R0Fuj;Vh$^^q$_;C$Jmg``?7?NxjZzRCjV;j7Zu`CG_nVPd_CMC{-tXS?y62pG&bj9<)?<@~RQus(u`&BIWg2Ly z^-P1F4iTsC=}7t39~9#__QEV2VrKX#{7PMY7M=go0pTT zno}ozw(>2YriC_ua}h^Ke%;bM7rS{-SbiGGfENcwXbOh0&vV7Uvjmj#uQKfmh(!*+LRXo>;8W_Z##JV@Kq9q;kl)hH6!P!~=bDf& z3AD~lA(yau0yc~ac@(9bdobSWjyj@a9-*&-_h6JDYWhpfB;27I_h8g)sbZad4<>|G z&R!4Qg9%e0dL*cE4<<;R=8GZ#urnARqie;@=^#WQeMF!iI|zLy&I!}I0TaZYJ*Dn( zcmTxiarnb&t)`LRMS26?WYV$V*n58%7NH9qt3lf?c2JEA9BQ`29VF6IK9rl{rv3Gi zZ*5%ZaN*Y8pnIylvZ5bH_%G0`9-cv17!LcLp6pvn->q>6(i3mwZ2vz8N8E2Bc}#(+ z+T+f7KSL)|4Q^B?z$<6%+~YH@hh&;RjlWS4iPsb?qBXDf1_VK5pWo6rpFcXW4i7WZ zqOV3wiN3!B^u5uGwRpgm=sN%aql7(OWOv}gb*t&h$mEKB^}?f!_!Jl-D<0atli76@z$iq z!Px`T-0e=lXum3n7@Znaa!a}PN3CPkNVo?-@X5Zio77r$FojT27%M`%hXqN^EA@H{9 zA!sWCfmodhs#K&Y;kow%;-v?|J@}&j$dM!Y2_akq&1-WT{zkhUN>12Qc;cgJQabV7 z>WLlt#i>#uPJ7eK3L$QYEqhE~d8RK0io3W8lAgk6o)Ge%(ng>Z!OOmAq!ea#=UK3; z6>{)JNC-)qa2;_Asr2=jDbeoBK)bWz$B&C6Mp?&nZIz!tZ z^^U1Gi7A~<`Z~Cre9|;M`VqU-VO9cL_Jn)fyHo{6!Z^Y;~+xed-;KgbMF9aj*%zuShi;^Q&^QQpPP02WZ=`t*xU+i|)2ffh- zx~S~aR_==~Fm`fZ&Kx>^m?HO~q}NbEgnH~y;Z3ACp)F^oNRNC7F1 zTsaV?b$YR8L<-SlkLp-6eX-PvH9P2Jsjg6v8KF@mp7VZ=GP*{P8J9o;l+}I(=YQP^ zGSi*8y&!XaqJ^T%hyh77&>T_9)rl_S!ZhjTt>`k2*4xJhi@nPYnbKtee#o>wEkm(V z4@gR()Tj`_nJb88#Y#WpTxX#L%e&4}pBU%PZI&{jOb$5fHp`}X)}MV&;|22Yu{d1W z4XIZd)Pvfm|CQ|(IuoFsNHLo44x~ti!J_rWZ5asap#_B7Xat3RxSdT8 zo4*03snZh8H0QLWIG)8c-iDwcxu*9e#l8c@4HK}hd8rW)y%hV`r~+uT9TkAWfQpcA zLV&D<^OM;72g7^+CN>FD>_?y~kx##HvfYDQyer*XyY10Bcq5E{B_ue$w2=`*x<<*v zumr*Zd>7-*VbtpxIOKr18&O)5JL%sfjxvmn9NTBZI&%EsK%&VA*PQvMmNQDETRW$= zhlBFHDR$w}3$Q8HLD9tcw$W&9|DgW>>;(4zjCG(xQg+{Y*3u3(GyF~ZDBiqy0qMwzp^dzGzpDQ2;6C%<9!h9h*bhf7?TTtJ&Y1LLYsabf&!8}&FwT)o1&~gdP!rO&yOK$>jz=;N@dLGc6MQHE#}Bl z*Y5+SzL;j}uv%Zge)gXFtV4ty-l+x0?7u0EO`j5VzR1Y5i$C4P(EmbI?#Ia>l=kb{ zS;P6qjoPL;A6DBg<|%snL%@0ekr!(_D@H^Wce~g%xd=3`s92f(HmYu#C?VC2@`XB% zF6{EfK`8Gxg#G7R*c9+(pVSUBZH_F5*#{6&O5yX9z~`HyJAAH!0hG6Pa_8CF3Dxod zZ5bJuH8=^`;l=8QN4&v7<(s8A`C|zFljvm{VmF%7U%;nmfqiQ6V~Z7iO>al@OEblr zC*OEM-OCN9M=#xUy*?uB3CClh`z`=$rP-dGNxu)W@87v7VX#rdXZh~@JLz&=?zy94 zB8h*FdM!^r2aAIaiUZxjjy_@jy*Xjhx$d&hqGrh2c%inMil?Ja7eyiKk9YehbN6IZ&J}_J_|F*R#4v@X}Hhfu~`%4ipj=)IcfB`6*ydDY2|5 zXE{*STspLK@_iKG7xzBon@fzAO*z0;HcvnL+s_L6zq+OIoWt#v-V%Q}lTN_kkPr#z z+kHyB&ByAJ#iv0YZuX9qC=LUWpKhrihpm$eI55|N4#B62+iPxJqg>~4iRQN_FTN=T z@2guH7f1%&2hER$>`_!Tv{f*wMtp)&`(jej@L@vD>C8#1G=* zR{HBpFXIo#9_tTI?EKn!jq@dqhwP`7(WPU7+UO!-X>%(lEp7{wbqAYA6z5Owm{)rP zJOK5t@w^mG_>KI>nEe=XpY{O__Y+Kv1W@q)x-$#stA&LV@NMj+Y0y1Wxct-4Z)}BR zcXx17Tn*xXkp(TH zMr$2Wd$CchomqH+&#(Uapwks79bo$-l2(n9n8|xl;=dY~pO!&%`AfV?k-;AZCqk!P zd{$Y9`;av5FRrVLar60>Z0cp$M^PKo-jLMB8dt57>FNNB)j}`db!K6!%|^k!CaaAL z`$Y)Jz#_f3b{WkjIlzJi#V&@H3y{R=Y{pjdU0o64vK~usQQJf zfn}Rl!}9n`5*GHb-)@B7vk;1&XwQBWD0i*RZB8w*)#f-IMFwE4;_-}8F_m2n@qCR& z^Qzd&{K<^aV-NIYgHS^e%?Oknu>lsid1-pHc` zce?SLlEjH^b-IXk*Wjk6_ z%D=rYwTcVx!+*Rpc7eQ_Ot|DYtXDVXob^vHU^=`&Q`q6a}?uu-(5#hNT$Z?zZ++fKK^TG(R{1(4=K_Xx=}n(6poaD*SJxPGb4_s zLy}r+tlv$hcb9Y`1Nc_tTU@qRr2P*S4~ z=2>{WjKINH+DS^6k+O&H-&WYyl5Pi895 zQ{$R2E{Uj@6;%bdf5~@6=?(6=qK5mLXweP6NzLwP3XOTCiB?-l&$+?V79ro1?sXOP zO#{@+cTYFz1+pq~*78(0#XtL-OCd(vhdAweD!|XscN`vj1&34`jY}lpP*k{P#JNqw1mwZ2j3;Zka12Id~>AgL_x9Pt*KoMJ=URi~Lo_$@HRnX8%KQ@~kKMw483C0E;@lq;2 z%9X{P6YKgidqB;czkkp@+3TKS^nOtzB<+z$bP8LJgSuBSuijwqNG5^Uac?NH?`07q=?YH3A^W89oao(Uc}^&2Dax*O zX5o2ybMfWCVcN6OKiXdLlA71fz9QoDEsM{jbw*1yW{gyE$G;u9cf>5Rq7Yw6$)P@t+R#ibNzq**qp>p#=v2pdZ?0py(p&c}B zG_;39qap|{OvbCdBfvE*3(!s3LSNt3xY%jv#P4{2#A?q;yGN=$r}MQAAkg&Ed#3md zsO(qb#=?$F7;f=?cDr9v8}KdB9GBXFIJ=3o;BVCW;!!{OVukk?7ZP4$>>oH&^8kx> zM@}p7R+U3^8>xC{(1|huh$fPRaR*Xr%!)!lIl#drO9sYg7G6k*0LA2Z6PRQs^PAk_ zcv>0v4`Wvm_jf-ipnC>|qfpE7J}~JB0n>ELPLa0sSr##z=JrWCn!%*T}4Qywk4E^9w=h9S_IY=Z6I|;Np&>e!PrtN zsazG7EWh@Qz=v0qyogT;?s})cdaSn$t!VGbNMq1-${seRX5Z{YU45~cS#g|oN)JQN+BvLHVwxL2^xUL!^IRwoJ<&fYp8sV(=QK5?B?UCk>)J=VE5rI&^J@z)$9)6}O=N=R zBriod7WDIi1;ARkHx(#~yd~Q6pOh0^U1Y%|UdvR`Jqju-` ziS8;`f&Wl;r0GnY>-d&uLtlm#`_eb=lm*;(aLTV=&2Ef{tCi2;C0HJM|6sgnS}4(* z_P$1JQq)(d35x=!)z;(&5j^0&BqGbQYcydgFZaFty^9YFR%ykJJqyU{36DPKf;=3#zj4@!P zlmxEz`t^IFC{j#P(|Kh#?=fXJw1A^m?#+rgrU-bb*G!qawu>H=^cuZp%A9XrQL!?E zu-UV?gURT}hxngM9M?f7`btCT8$MAny*4vtR2ke1RE{Z)j&Q$9u;p+!)L}*eV`&rc zQhfyzWq6GaGi53Sw|cb{0Nu9Q1viY=1NJbIicvkl9oVLEOL%)OLk7K;(>m08Fd)z=R_@0@-gKwsp@M*KTR}Qo+3g9P$`9^L4M2IwHMi4?ZOUok zBNst$N(JPQU-rY8G;JJ}7p*?Zp*n!M9>GEcqP7dVk7x#@k{DH(CkNjXNZ;~#~JeY5S62kfcmTq&8$`2lsi#OB5Rbf>dnP16YNKzQF@Sy{Yuyqr0d%Qo}ec{`3~SO z00DQRZ9vU3m*)8mqL)+sjbbYQ$Meq|FYjZ|ZCvCvdt|>;4(rheAU6i*O@-o4r#0OV z+{ubNJneM@yFMbpc0kYT5BkT(51}=f@>?C( z0`4wiy>w7bIPeWC9!Po&JpwwJC_DmpLd2MMPTid*yn{X7{)%@73S+Y=r;I1JHZB01 zbnOc~Eag}A(9OeLMPp5abfizV)?jy*BA=YDy3(jXi3=W?=%QM!s>Ekm*<^UinxS1B zg2YQVhf+{C&%QdMb&XUY3Q{@AdB^NuDZNBj*7B26`l~Q{C=Z_oFcEs_W;Q9ZC;mH82TsD^zIRSk`vQZ>j|+#YnAqExO-~FI~(2BlvBzlw#gyCQK&Zs(nbL~yE0;pL z%usQnR($q6C~dTaTBE(al3xyK`(idSaIqAfF}mbfIb-HKggxa10*6NZ>||+=gnRbH z4~>*$@pG00Q*6O8e~?uadC>O7)dPqb-HgxTN^yS`Zi(l`WK?Rl`jx$rPaKI#G+Gkhk-c}P`){YLrvRo z?oewGkf?Nv3o|zOLcN|z82b3l#B|Yt0H|9JO-C*OC7nVy@FH$ecN!cRom5i7f^M+D zs>XX(7UOISzH9-?Ul~Q8n%@1&r`BXfq*8W2f2~Zr)TLcu*^+Q=|A8X^p?VGH5F%^( z2fY;g7=}e6L0|o;cB-p#gnG1ast<;rNVthjf)0BM?nm+I4-MN#SGpBlfXpBxiW&?0 zeu;F1jv^_{7M2j$r)=ynniwX5Qh<1kXqdV7ZN77T~tp0^VdZ z|L{!ylbc5Sd1f9U3R16mz4eJKxKD+feLh_AM88=asCX)EaoQ;HuR~4K`31)bi{9T> zygrieO%?50$GuHC;5^)DTq2)a+%s6~>>u%pRh&+`R~ecpx2NNi0e&D-dU3&_h`4z{ltG$;Z9Eg276oUezQoH?#HP#k}=({KM3i514JF&k5f}c^+-G5wfI@JB< zH&G^L>V5>85Zp?}epuc-kkhiBop>9_ zm11ASXD#XBkiz2621w+Z+tnkpz#<=rO)-=IVta!bibKa+d60nT9R1p4x^R)QlQ@$t`>8n6jSj>2r`AppYuQ@N#thCQdWeig^ z3-5UIEi@~m3iqC9u?dNH^9m`!ElYItdh8Pz9H+52XC{q1hzf2>I_cx{m(Nq&?m4aT zmmo>R*a!5ni9YaI$0iNEmdzB-{Ttw%e$uc^N!xg;4Wo%m-7i?#Io%Cf&Ea>R*SG|X zTY)H~MeKm-+D8(b)DHrUz-cFH;XBOT-~N2He((_8QQ%lpWm@ zs?PprGes+6a!G-5OfPCbZhKwYHLov;K`PYjd(LZI1kAX5z1O+xWOp#=Ep-`vfb>RA z!icv6BM#JI#9IK=7BsFCuqLzNr)G*bPMr-l)tav&nNSTe`=RrAYd3!T#$szEkKhfS zgc0umMjWcch@pE^FTG{oPtHW++me=AK~kOo-wPfonoW`qQGnTJWCjeTly`|3oji~n zlfxz8Ph$vs@XreT)tb~dEymLUJtCE0%{sAf9CH)kT z@0AtgqfaLk?N+1h&@+Vd96cmGzO`|Y6k6~kM{PJc4kx*D?oEaEn0A8P58UI{WOvRb zZwyv{VNOPLDBC_6;irg1ic`VQMgIteP?T*;Fj_rD-EgI1{9NQzDtf4C=KvQO^S1i& z#_TTb5zUIq68D2*6u~v|Sd@v{-a?5h^{Ry-PUcdjE?U<-tF995g2s`nrU*_`VC;~USzAPsv5Ni zP+BPK#jSr2TkWN#)^Pz^tHWUn9U2aVDqG(5YG*!wXS(>vYvXa0} zQbcbEtJN%BL~jOruFgb7^b%3I0sq9fIdsL6?dIf)#P@eykKi*wdi@r|G$!63ip(vnh7AA+)$U^TC(SeIE3*U+L3cxultSG0N8P#p>{6GeMr zl#DM%y}l|V(R{w7kg!{NEt5W`i;|7UCv*UcMbwk$qlK$Cy&7?g$?O~8?8)abENfSB z+od$NEa@q}``-ZRFcEJ`(ZSn|MQYW$IoYDn2v!2ObB z#Qk33ez^nd5&N%z*tca8+uGx$$oYYg_w|mcdS8-|NT24*LR2O}WL#at31(NjbN~8U zg}T;b>d}?g4(oh>Sry^grJQP~bko{274{Gb(7aqxuM7zLQt+%tUv?{<3+qwt4}fwv zRY+v~AVrbzd#AeJfrjqU_MAQAec-aj#gZ31@~g@yzGnPPIt*j`nd;lD3@2RJ+=i@F zf+ix)0K*1wDVS!9JDN_!+n}VK61~KjJ((Uy^YM#XU;KbyBqXs+^fxn5f-Y8AhD|dL zw4?T-5KeR}Qfx54YxiP`bK19|Sh$$_{-2Zy1t6q`v^pB{TnU#Fy_V@cEAo~ZYM7g=?t}bEE|H{0qJJ#8_S)1=cNC)nxc!&lF35{vyqY_X^ zl*<=J28qe>_r-N9L88F6|F0&tOQrODW0vjzBb+&m z3;F*V2JMqmS|ii{H~4D*zr0qS|8J&5tYiMa`a)j9nb7|?tE2nrdb8E;r#seBA`|=n zny%>o<1e0W|KE@(ux%^+|6F({cRv-RS)>oSp9uK|Mfysoj@oLu?q`(l!t0QJx^_Pi zbQF?GNH@iF|K(P^QhRu9bq^GxpK5Om`Rx+_st|qfa}&C9+gX#L9*Nx)GM~5;7E`!W zYvvxZ|6}5J^!*AuerG;LR8lPXPuPJVH;#RBZMC&5Ne$8&4E*0a8*?A!lyH|;{sW%- z5p@m*SaZ$RT5rst8c<}AEAy>B6A|&)#UZnL!5d2GKp2U?u=4k^vxV%t&D+8>ukDbZ zK>$%s;q?ar*IC%xZ|-(R>ZMfFRTk}S>mOwLn~H_VnIX<}eeWc+FmJOgUlyi4X%h-G zw9xe(v5Q6K6A=x(FWiA^H=7(!_9>Z;Qm>y?mRQR%luV~E_)EaxrpI7xo@76bOFxDd zWcYVQ4~cPx+im3_`iIY>$q&V~9RjFLF*gri+&Etrgb#T|r*C9vv2<;MngaJI-8Ebd zbiXe0p95(xF9StEXD`jK4^|)$I%JKf6P;ndu`21-#;g~(5Yyqv-q4vfF{zYVG4LPp3y9~Kd^2x1O%3wmvJxtutl$KiD z1vZ7!(DYH~pkQfru}!{IPmz3~cv%+7n-}{tGiWq-(caaQ?UmjVNY(B(RAp9_GkPQQ zvHUnFupl}7}!5SlSQ9H zxvh~T(T0jHc#{K#d3ud^?{%K#v6Vr|q3WAR11B!K<}>W=z%czF9MF-=rPb`9T0ZaC zSyv?lB=t{W_Z?c}Qp)JvCkH&;Xl|b(nh$MhJm;|5j*K=aIK)MjuF8|+hWOcm?r^OS zDdys5fxkQb4XOA%Y^fbtZa^$l>9OMGEcIjUKb*K(#Mjys2jTq}H!d(<Fmww4&D)hCzHqt&$; z8>&yX)=rEUXW#;TnR$Kk;;21ZA668+=`jXYWE<_znz2Luy;cqnlq<1)Ol$O_hAA+> z<8p0&S!0<|X>2e+Y*U0ZRB3GC7Cj@^s5G|lZazP>R%)fO!C3nl6}b*GS~wfit2DOo zVIOr)!E{Uq@}%-)XrRjB+855w`S)b>o^kbd#Ur@rUz~pOokpA7G976j;M{7HYl)8? zJ9y@_$$jF2Mgz!yaD8>PyE0^-D~A#2j%2QJH?!bopqZ%0x>FRldWVQ>*()N>nH5U_ zULYFQ3vcv&2N_P#pdi#KiuY|+*IT)(=3w>KNKlaqL&slu3vEz^k~A`MfiY*3h&$6~ z2(W`0nCYR;>ux2?gj*1Q3N;xG>j5;HO)?gtAT}Un>gRqy_ygxRyqo0=`uSofKiZ*@n()5JLKhU?h1^|-+AIX~;3c5lS!5CH$P12YO# z3hj@Rw3ikr8Zu1~pZQY&;ig1oo;t7bO`J4C_M=LID-J$Ngpqnzl4gLPEw(9NU%%fGd8mHKb)s?lJ*`|US0^lzYx j)2P>JHm~jtA*sgoogle.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..3bcdbe4da128 --- /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 created 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 created 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 created 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 created 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..24b9618da89e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures.php @@ -0,0 +1,301 @@ +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; + /** + * Type of Performance Monitoring Unit requested on instance. + * Check the PerformanceMonitoringUnit enum for the list of possible values. + * + * Generated from protobuf field optional string performance_monitoring_unit = 533618956; + */ + protected $performance_monitoring_unit = 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; + /** + * Turbo frequency mode to use for the instance. Supported modes include: * ALL_CORE_MAX Using empty string or not setting this field will use the platform-specific default turbo mode. + * + * Generated from protobuf field optional string turbo_mode = 432965412; + */ + protected $turbo_mode = 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 string $performance_monitoring_unit + * Type of Performance Monitoring Unit requested on instance. + * Check the PerformanceMonitoringUnit enum for the list of possible values. + * @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 string $turbo_mode + * Turbo frequency mode to use for the instance. Supported modes include: * ALL_CORE_MAX Using empty string or not setting this field will use the platform-specific default turbo mode. + * @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; + } + + /** + * Type of Performance Monitoring Unit requested on instance. + * Check the PerformanceMonitoringUnit enum for the list of possible values. + * + * Generated from protobuf field optional string performance_monitoring_unit = 533618956; + * @return string + */ + public function getPerformanceMonitoringUnit() + { + return isset($this->performance_monitoring_unit) ? $this->performance_monitoring_unit : ''; + } + + public function hasPerformanceMonitoringUnit() + { + return isset($this->performance_monitoring_unit); + } + + public function clearPerformanceMonitoringUnit() + { + unset($this->performance_monitoring_unit); + } + + /** + * Type of Performance Monitoring Unit requested on instance. + * Check the PerformanceMonitoringUnit enum for the list of possible values. + * + * Generated from protobuf field optional string performance_monitoring_unit = 533618956; + * @param string $var + * @return $this + */ + public function setPerformanceMonitoringUnit($var) + { + GPBUtil::checkString($var, True); + $this->performance_monitoring_unit = $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; + } + + /** + * Turbo frequency mode to use for the instance. Supported modes include: * ALL_CORE_MAX Using empty string or not setting this field will use the platform-specific default turbo mode. + * + * Generated from protobuf field optional string turbo_mode = 432965412; + * @return string + */ + public function getTurboMode() + { + return isset($this->turbo_mode) ? $this->turbo_mode : ''; + } + + public function hasTurboMode() + { + return isset($this->turbo_mode); + } + + public function clearTurboMode() + { + unset($this->turbo_mode); + } + + /** + * Turbo frequency mode to use for the instance. Supported modes include: * ALL_CORE_MAX Using empty string or not setting this field will use the platform-specific default turbo mode. + * + * Generated from protobuf field optional string turbo_mode = 432965412; + * @param string $var + * @return $this + */ + public function setTurboMode($var) + { + GPBUtil::checkString($var, True); + $this->turbo_mode = $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/AdvancedMachineFeatures/PerformanceMonitoringUnit.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures/PerformanceMonitoringUnit.php new file mode 100644 index 000000000000..6878febfc51f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AdvancedMachineFeatures/PerformanceMonitoringUnit.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.AdvancedMachineFeatures.PerformanceMonitoringUnit + */ +class PerformanceMonitoringUnit +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_PERFORMANCE_MONITORING_UNIT = 0; + */ + const UNDEFINED_PERFORMANCE_MONITORING_UNIT = 0; + /** + * Architecturally defined non-LLC events. + * + * Generated from protobuf enum ARCHITECTURAL = 155113693; + */ + const ARCHITECTURAL = 155113693; + /** + * Most documented core/L2 and LLC events. + * + * Generated from protobuf enum ENHANCED = 476873590; + */ + const ENHANCED = 476873590; + /** + * Generated from protobuf enum PERFORMANCE_MONITORING_UNIT_UNSPECIFIED = 429210692; + */ + const PERFORMANCE_MONITORING_UNIT_UNSPECIFIED = 429210692; + /** + * Most documented core/L2 events. + * + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + + private static $valueToName = [ + self::UNDEFINED_PERFORMANCE_MONITORING_UNIT => 'UNDEFINED_PERFORMANCE_MONITORING_UNIT', + self::ARCHITECTURAL => 'ARCHITECTURAL', + self::ENHANCED => 'ENHANCED', + self::PERFORMANCE_MONITORING_UNIT_UNSPECIFIED => 'PERFORMANCE_MONITORING_UNIT_UNSPECIFIED', + 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(PerformanceMonitoringUnit::class, \Google\Cloud\Compute\V1\AdvancedMachineFeatures_PerformanceMonitoringUnit::class); + 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..4eeaca0a912e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AllocationAggregateReservation/VmFamily.php @@ -0,0 +1,75 @@ +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_DEVICE_CT3 = 42845948; + */ + const VM_FAMILY_CLOUD_TPU_DEVICE_CT3 = 42845948; + /** + * 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_CT3P = 517384376; + */ + const VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P = 517384376; + /** + * 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_DEVICE_CT3 => 'VM_FAMILY_CLOUD_TPU_DEVICE_CT3', + 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_CT3P => 'VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P', + 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..f4d4b85cdd42 --- /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. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method. + * + * 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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method. + * @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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method. + * + * 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. Note: Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. You cannot create VMs that have disks with customer-supplied keys using the bulk insert method. + * + * 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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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..702e7bf0cb64 --- /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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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 boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. 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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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 boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. 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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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 boot disk, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required. 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 boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. 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 boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. 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..ba2325a3abfc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditConfig.php @@ -0,0 +1,138 @@ +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; + /** + * 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 + * @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; + } + + /** + * Generated from protobuf field repeated string exempted_members = 232615576; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemptedMembers() + { + return $this->exempted_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; + } + + /** + * 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..9ed971092a38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/AuditLogConfig.php @@ -0,0 +1,152 @@ +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; + /** + * 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 + * @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; + } + + /** + * 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); + } + + /** + * 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/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..4bee79c7d456 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucket.php @@ -0,0 +1,589 @@ +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; + /** + * [Output Only] List of resources referencing that backend bucket. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketUsedBy used_by = 389320729; + */ + private $used_by; + + /** + * 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. + * @type array<\Google\Cloud\Compute\V1\BackendBucketUsedBy>|\Google\Protobuf\Internal\RepeatedField $used_by + * [Output Only] List of resources referencing that backend bucket. + * } + */ + 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; + } + + /** + * [Output Only] List of resources referencing that backend bucket. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketUsedBy used_by = 389320729; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUsedBy() + { + return $this->used_by; + } + + /** + * [Output Only] List of resources referencing that backend bucket. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.BackendBucketUsedBy used_by = 389320729; + * @param array<\Google\Cloud\Compute\V1\BackendBucketUsedBy>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUsedBy($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendBucketUsedBy::class); + $this->used_by = $arr; + + 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..137938af3f54 --- /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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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..45eada7bccc4 --- /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/BackendBucketUsedBy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketUsedBy.php new file mode 100644 index 000000000000..f1c68dfba688 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendBucketUsedBy.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.BackendBucketUsedBy + */ +class BackendBucketUsedBy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Server-defined URL for UrlMaps referencing that BackendBucket. + * + * 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 + * [Output Only] Server-defined URL for UrlMaps referencing that BackendBucket. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Server-defined URL for UrlMaps referencing that BackendBucket. + * + * 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); + } + + /** + * [Output Only] Server-defined URL for UrlMaps referencing that BackendBucket. + * + * 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/BackendService.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService.php new file mode 100644 index 000000000000..388469c473dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService.php @@ -0,0 +1,1892 @@ +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; + /** + * Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). + * Check the IpAddressSelectionPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string ip_address_selection_policy = 77600840; + */ + protected $ip_address_selection_policy = 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 configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. 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; + /** + * Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722; + */ + protected $strong_session_affinity_cookie = 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; + /** + * [Output Only] List of resources referencing given backend service. + * + * 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 $ip_address_selection_policy + * Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). + * Check the IpAddressSelectionPolicy enum for the list of possible values. + * @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 configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. 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\BackendServiceHttpCookie $strong_session_affinity_cookie + * Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + * @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 + * [Output Only] List of resources referencing given backend service. + * } + */ + 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; + } + + /** + * Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). + * Check the IpAddressSelectionPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string ip_address_selection_policy = 77600840; + * @return string + */ + public function getIpAddressSelectionPolicy() + { + return isset($this->ip_address_selection_policy) ? $this->ip_address_selection_policy : ''; + } + + public function hasIpAddressSelectionPolicy() + { + return isset($this->ip_address_selection_policy); + } + + public function clearIpAddressSelectionPolicy() + { + unset($this->ip_address_selection_policy); + } + + /** + * Specifies a preference for traffic sent from the proxy to the backend (or from the client to the backend for proxyless gRPC). The possible values are: - IPV4_ONLY: Only send IPv4 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv4 health checks are used to check the health of the backends. This is the default setting. - PREFER_IPV6: Prioritize the connection to the endpoint's IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). - IPV6_ONLY: Only send IPv6 traffic to the backends of the backend service (Instance Group, Managed Instance Group, Network Endpoint Group), regardless of traffic from the client to the proxy. Only IPv6 health checks are used to check the health of the backends. This field is applicable to either: - Advanced global external Application Load Balancer (load balancing scheme EXTERNAL_MANAGED), - Regional external Application Load Balancer, - Internal proxy Network Load Balancer (load balancing scheme INTERNAL_MANAGED), - Regional internal Application Load Balancer (load balancing scheme INTERNAL_MANAGED), - Traffic Director with Envoy proxies and proxyless gRPC (load balancing scheme INTERNAL_SELF_MANAGED). + * Check the IpAddressSelectionPolicy enum for the list of possible values. + * + * Generated from protobuf field optional string ip_address_selection_policy = 77600840; + * @param string $var + * @return $this + */ + public function setIpAddressSelectionPolicy($var) + { + GPBUtil::checkString($var, True); + $this->ip_address_selection_policy = $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 configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. 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 configured—that is, if session affinity remains at the default value of NONE—then the default value for localityLbPolicy is ROUND_ROBIN. If session affinity is set to a value other than NONE, then the default value for localityLbPolicy is MAGLEV. 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; + } + + /** + * Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722; + * @return \Google\Cloud\Compute\V1\BackendServiceHttpCookie|null + */ + public function getStrongSessionAffinityCookie() + { + return $this->strong_session_affinity_cookie; + } + + public function hasStrongSessionAffinityCookie() + { + return isset($this->strong_session_affinity_cookie); + } + + public function clearStrongSessionAffinityCookie() + { + unset($this->strong_session_affinity_cookie); + } + + /** + * Describes the HTTP cookie used for stateful session affinity. This field is applicable and required if the sessionAffinity is set to STRONG_COOKIE_AFFINITY. + * + * Generated from protobuf field optional .google.cloud.compute.v1.BackendServiceHttpCookie strong_session_affinity_cookie = 238195722; + * @param \Google\Cloud\Compute\V1\BackendServiceHttpCookie $var + * @return $this + */ + public function setStrongSessionAffinityCookie($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\BackendServiceHttpCookie::class); + $this->strong_session_affinity_cookie = $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; + } + + /** + * [Output Only] List of resources referencing given backend service. + * + * 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; + } + + /** + * [Output Only] List of resources referencing given backend service. + * + * 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/IpAddressSelectionPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/IpAddressSelectionPolicy.php new file mode 100644 index 000000000000..200312eccb59 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/IpAddressSelectionPolicy.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.BackendService.IpAddressSelectionPolicy + */ +class IpAddressSelectionPolicy +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IP_ADDRESS_SELECTION_POLICY = 0; + */ + const UNDEFINED_IP_ADDRESS_SELECTION_POLICY = 0; + /** + * Only send IPv4 traffic to the backends of the Backend Service (Instance Group, Managed Instance Group, Network Endpoint Group) regardless of traffic from the client to the proxy. Only IPv4 health-checks are used to check the health of the backends. This is the default setting. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + /** + * Only send IPv6 traffic to the backends of the Backend Service (Instance Group, Managed Instance Group, Network Endpoint Group) regardless of traffic from the client to the proxy. Only IPv6 health-checks are used to check the health of the backends. + * + * Generated from protobuf enum IPV6_ONLY = 79632100; + */ + const IPV6_ONLY = 79632100; + /** + * Unspecified IP address selection policy. + * + * Generated from protobuf enum IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED = 36210144; + */ + const IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED = 36210144; + /** + * Prioritize the connection to the endpoints IPv6 address over its IPv4 address (provided there is a healthy IPv6 address). + * + * Generated from protobuf enum PREFER_IPV6 = 408601302; + */ + const PREFER_IPV6 = 408601302; + + private static $valueToName = [ + self::UNDEFINED_IP_ADDRESS_SELECTION_POLICY => 'UNDEFINED_IP_ADDRESS_SELECTION_POLICY', + self::IPV4_ONLY => 'IPV4_ONLY', + self::IPV6_ONLY => 'IPV6_ONLY', + self::IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED => 'IP_ADDRESS_SELECTION_POLICY_UNSPECIFIED', + self::PREFER_IPV6 => 'PREFER_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(IpAddressSelectionPolicy::class, \Google\Cloud\Compute\V1\BackendService_IpAddressSelectionPolicy::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..71f7a6beccf6 --- /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..74aff34c4a14 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendService/SessionAffinity.php @@ -0,0 +1,113 @@ +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; + /** + * Strong cookie-based affinity. Connections bearing the same cookie will be served by the same backend VM while that VM remains healthy, as long as the cookie has not expired. + * + * Generated from protobuf enum STRONG_COOKIE_AFFINITY = 438628091; + */ + const STRONG_COOKIE_AFFINITY = 438628091; + + 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', + self::STRONG_COOKIE_AFFINITY => 'STRONG_COOKIE_AFFINITY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no 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..3e8642d0a8a6 --- /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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. + * 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..95f4a57138fc --- /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/BackendServiceHttpCookie.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceHttpCookie.php new file mode 100644 index 000000000000..d877f8b5f73e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceHttpCookie.php @@ -0,0 +1,165 @@ +google.cloud.compute.v1.BackendServiceHttpCookie + */ +class BackendServiceHttpCookie 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/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..7531442bd4fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/BackendServiceUsedBy.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.BackendServiceUsedBy + */ +class BackendServiceUsedBy extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Server-defined URL for resources referencing given BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and ForwardingRule. + * + * 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 + * [Output Only] Server-defined URL for resources referencing given BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and ForwardingRule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Server-defined URL for resources referencing given BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and ForwardingRule. + * + * 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); + } + + /** + * [Output Only] Server-defined URL for resources referencing given BackendService like UrlMaps, TargetTcpProxies, TargetSslProxies and ForwardingRule. + * + * 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..274655beadf9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Binding.php @@ -0,0 +1,192 @@ +google.cloud.compute.v1.Binding + */ +class Binding extends \Google\Protobuf\Internal\Message +{ + /** + * 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 + * @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); + } + + /** + * 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); + } + + /** + * 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..83ead47987d9 --- /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 choosing 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 choosing 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 choosing 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 choosing 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..944d937a8c81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment.php @@ -0,0 +1,1021 @@ +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; + /** + * [Input Only] Optional, specifies the CUD end time requested by the customer in RFC3339 text format. Needed when the customer wants CUD's end date is later than the start date + term duration. + * + * Generated from protobuf field optional string custom_end_timestamp = 181770852; + */ + protected $custom_end_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; + /** + * [Output Only] Status information for Commitment resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315; + */ + protected $resource_status = null; + /** + * 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 $custom_end_timestamp + * [Input Only] Optional, specifies the CUD end time requested by the customer in RFC3339 text format. Needed when the customer wants CUD's end date is later than the start date + term duration. + * @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 \Google\Cloud\Compute\V1\CommitmentResourceStatus $resource_status + * [Output Only] Status information for Commitment resource. + * @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; + } + + /** + * [Input Only] Optional, specifies the CUD end time requested by the customer in RFC3339 text format. Needed when the customer wants CUD's end date is later than the start date + term duration. + * + * Generated from protobuf field optional string custom_end_timestamp = 181770852; + * @return string + */ + public function getCustomEndTimestamp() + { + return isset($this->custom_end_timestamp) ? $this->custom_end_timestamp : ''; + } + + public function hasCustomEndTimestamp() + { + return isset($this->custom_end_timestamp); + } + + public function clearCustomEndTimestamp() + { + unset($this->custom_end_timestamp); + } + + /** + * [Input Only] Optional, specifies the CUD end time requested by the customer in RFC3339 text format. Needed when the customer wants CUD's end date is later than the start date + term duration. + * + * Generated from protobuf field optional string custom_end_timestamp = 181770852; + * @param string $var + * @return $this + */ + public function setCustomEndTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->custom_end_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; + } + + /** + * [Output Only] Status information for Commitment resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315; + * @return \Google\Cloud\Compute\V1\CommitmentResourceStatus|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 Commitment resource. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315; + * @param \Google\Cloud\Compute\V1\CommitmentResourceStatus $var + * @return $this + */ + public function setResourceStatus($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CommitmentResourceStatus::class); + $this->resource_status = $var; + + 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..83ff9af7f63f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Commitment/Type.php @@ -0,0 +1,170 @@ +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 ACCELERATOR_OPTIMIZED_A3_MEGA = 156517459; + */ + const ACCELERATOR_OPTIMIZED_A3_MEGA = 156517459; + /** + * 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_C4 = 301911817; + */ + const GENERAL_PURPOSE_C4 = 301911817; + /** + * Generated from protobuf enum GENERAL_PURPOSE_C4A = 232460888; + */ + const GENERAL_PURPOSE_C4A = 232460888; + /** + * 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 MEMORY_OPTIMIZED_X4_16TB = 183089120; + */ + const MEMORY_OPTIMIZED_X4_16TB = 183089120; + /** + * Generated from protobuf enum MEMORY_OPTIMIZED_X4_24TB = 183116989; + */ + const MEMORY_OPTIMIZED_X4_24TB = 183116989; + /** + * Generated from protobuf enum MEMORY_OPTIMIZED_X4_32TB = 183144858; + */ + const MEMORY_OPTIMIZED_X4_32TB = 183144858; + /** + * 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::ACCELERATOR_OPTIMIZED_A3_MEGA => 'ACCELERATOR_OPTIMIZED_A3_MEGA', + 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_C4 => 'GENERAL_PURPOSE_C4', + self::GENERAL_PURPOSE_C4A => 'GENERAL_PURPOSE_C4A', + 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::MEMORY_OPTIMIZED_X4_16TB => 'MEMORY_OPTIMIZED_X4_16TB', + self::MEMORY_OPTIMIZED_X4_24TB => 'MEMORY_OPTIMIZED_X4_24TB', + self::MEMORY_OPTIMIZED_X4_32TB => 'MEMORY_OPTIMIZED_X4_32TB', + 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/CommitmentResourceStatus.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentResourceStatus.php new file mode 100644 index 000000000000..9803184c5f75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CommitmentResourceStatus.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.CommitmentResourceStatus + */ +class CommitmentResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] Indicates the end time of customer's eligibility to send custom term requests in RFC3339 text format. Term extension requests that (not the end time in the request) after this time will be rejected. + * + * Generated from protobuf field optional string custom_term_eligibility_end_timestamp = 363976187; + */ + protected $custom_term_eligibility_end_timestamp = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $custom_term_eligibility_end_timestamp + * [Output Only] Indicates the end time of customer's eligibility to send custom term requests in RFC3339 text format. Term extension requests that (not the end time in the request) after this time will be rejected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Output Only] Indicates the end time of customer's eligibility to send custom term requests in RFC3339 text format. Term extension requests that (not the end time in the request) after this time will be rejected. + * + * Generated from protobuf field optional string custom_term_eligibility_end_timestamp = 363976187; + * @return string + */ + public function getCustomTermEligibilityEndTimestamp() + { + return isset($this->custom_term_eligibility_end_timestamp) ? $this->custom_term_eligibility_end_timestamp : ''; + } + + public function hasCustomTermEligibilityEndTimestamp() + { + return isset($this->custom_term_eligibility_end_timestamp); + } + + public function clearCustomTermEligibilityEndTimestamp() + { + unset($this->custom_term_eligibility_end_timestamp); + } + + /** + * [Output Only] Indicates the end time of customer's eligibility to send custom term requests in RFC3339 text format. Term extension requests that (not the end time in the request) after this time will be rejected. + * + * Generated from protobuf field optional string custom_term_eligibility_end_timestamp = 363976187; + * @param string $var + * @return $this + */ + public function setCustomTermEligibilityEndTimestamp($var) + { + GPBUtil::checkString($var, True); + $this->custom_term_eligibility_end_timestamp = $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/ConfidentialInstanceConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig.php new file mode 100644 index 000000000000..2e33e1d9eada --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig.php @@ -0,0 +1,125 @@ +google.cloud.compute.v1.ConfidentialInstanceConfig + */ +class ConfidentialInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Defines the type of technology used by the confidential instance. + * Check the ConfidentialInstanceType enum for the list of possible values. + * + * Generated from protobuf field optional string confidential_instance_type = 43484717; + */ + protected $confidential_instance_type = null; + /** + * 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 string $confidential_instance_type + * Defines the type of technology used by the confidential instance. + * Check the ConfidentialInstanceType enum for the list of possible values. + * @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 the type of technology used by the confidential instance. + * Check the ConfidentialInstanceType enum for the list of possible values. + * + * Generated from protobuf field optional string confidential_instance_type = 43484717; + * @return string + */ + public function getConfidentialInstanceType() + { + return isset($this->confidential_instance_type) ? $this->confidential_instance_type : ''; + } + + public function hasConfidentialInstanceType() + { + return isset($this->confidential_instance_type); + } + + public function clearConfidentialInstanceType() + { + unset($this->confidential_instance_type); + } + + /** + * Defines the type of technology used by the confidential instance. + * Check the ConfidentialInstanceType enum for the list of possible values. + * + * Generated from protobuf field optional string confidential_instance_type = 43484717; + * @param string $var + * @return $this + */ + public function setConfidentialInstanceType($var) + { + GPBUtil::checkString($var, True); + $this->confidential_instance_type = $var; + + return $this; + } + + /** + * 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/ConfidentialInstanceConfig/ConfidentialInstanceType.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig/ConfidentialInstanceType.php new file mode 100644 index 000000000000..0d45e507308f --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ConfidentialInstanceConfig/ConfidentialInstanceType.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.ConfidentialInstanceConfig.ConfidentialInstanceType + */ +class ConfidentialInstanceType +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_CONFIDENTIAL_INSTANCE_TYPE = 0; + */ + const UNDEFINED_CONFIDENTIAL_INSTANCE_TYPE = 0; + /** + * No type specified. Do not use this value. + * + * Generated from protobuf enum CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED = 115021829; + */ + const CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED = 115021829; + /** + * AMD Secure Encrypted Virtualization. + * + * Generated from protobuf enum SEV = 81988; + */ + const SEV = 81988; + /** + * AMD Secure Encrypted Virtualization - Secure Nested Paging. + * + * Generated from protobuf enum SEV_SNP = 21753562; + */ + const SEV_SNP = 21753562; + /** + * Intel Trust Domain eXtension. + * + * Generated from protobuf enum TDX = 82920; + */ + const TDX = 82920; + + private static $valueToName = [ + self::UNDEFINED_CONFIDENTIAL_INSTANCE_TYPE => 'UNDEFINED_CONFIDENTIAL_INSTANCE_TYPE', + self::CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED => 'CONFIDENTIAL_INSTANCE_TYPE_UNSPECIFIED', + self::SEV => 'SEV', + self::SEV_SNP => 'SEV_SNP', + self::TDX => 'TDX', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConfidentialInstanceType::class, \Google\Cloud\Compute\V1\ConfidentialInstanceConfig_ConfidentialInstanceType::class); + 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/CustomErrorResponsePolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomErrorResponsePolicy.php new file mode 100644 index 000000000000..25a44acdc4e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomErrorResponsePolicy.php @@ -0,0 +1,111 @@ +google.cloud.compute.v1.CustomErrorResponsePolicy + */ +class CustomErrorResponsePolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304; + */ + private $error_response_rules; + /** + * The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers. + * + * Generated from protobuf field optional string error_service = 164214654; + */ + protected $error_service = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Compute\V1\CustomErrorResponsePolicyCustomErrorResponseRule>|\Google\Protobuf\Internal\RepeatedField $error_response_rules + * Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + * @type string $error_service + * The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrorResponseRules() + { + return $this->error_response_rules; + } + + /** + * Specifies rules for returning error responses. In a given policy, if you specify rules for both a range of error codes as well as rules for specific error codes then rules with specific error codes have a higher priority. For example, assume that you configure a rule for 401 (Un-authorized) code, and another for all 4 series error codes (4XX). If the backend service returns a 401, then the rule for 401 will be applied. However if the backend service returns a 403, the rule for 4xx takes effect. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule error_response_rules = 14620304; + * @param array<\Google\Cloud\Compute\V1\CustomErrorResponsePolicyCustomErrorResponseRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrorResponseRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\CustomErrorResponsePolicyCustomErrorResponseRule::class); + $this->error_response_rules = $arr; + + return $this; + } + + /** + * The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers. + * + * Generated from protobuf field optional string error_service = 164214654; + * @return string + */ + public function getErrorService() + { + return isset($this->error_service) ? $this->error_service : ''; + } + + public function hasErrorService() + { + return isset($this->error_service); + } + + public function clearErrorService() + { + unset($this->error_service); + } + + /** + * The full or partial URL to the BackendBucket resource that contains the custom error content. Examples are: - https://www.googleapis.com/compute/v1/projects/project/global/backendBuckets/myBackendBucket - compute/v1/projects/project/global/backendBuckets/myBackendBucket - global/backendBuckets/myBackendBucket If errorService is not specified at lower levels like pathMatcher, pathRule and routeRule, an errorService specified at a higher level in the UrlMap will be used. If UrlMap.defaultCustomErrorResponsePolicy contains one or more errorResponseRules[], it must specify errorService. If load balancer cannot reach the backendBucket, a simple Not Found Error will be returned, with the original response code (or overrideResponseCode if configured). errorService is not supported for internal or regional HTTP/HTTPS load balancers. + * + * Generated from protobuf field optional string error_service = 164214654; + * @param string $var + * @return $this + */ + public function setErrorService($var) + { + GPBUtil::checkString($var, True); + $this->error_service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomErrorResponsePolicyCustomErrorResponseRule.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomErrorResponsePolicyCustomErrorResponseRule.php new file mode 100644 index 000000000000..4c1a744e7d3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/CustomErrorResponsePolicyCustomErrorResponseRule.php @@ -0,0 +1,155 @@ +google.cloud.compute.v1.CustomErrorResponsePolicyCustomErrorResponseRule + */ +class CustomErrorResponsePolicyCustomErrorResponseRule extends \Google\Protobuf\Internal\Message +{ + /** + * Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy. + * + * Generated from protobuf field repeated string match_response_codes = 104973410; + */ + private $match_response_codes; + /** + * The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + * + * Generated from protobuf field optional int32 override_response_code = 530328568; + */ + protected $override_response_code = null; + /** + * The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters + * + * Generated from protobuf field optional string path = 3433509; + */ + protected $path = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $match_response_codes + * Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy. + * @type int $override_response_code + * The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + * @type string $path + * The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy. + * + * Generated from protobuf field repeated string match_response_codes = 104973410; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMatchResponseCodes() + { + return $this->match_response_codes; + } + + /** + * Valid values include: - A number between 400 and 599: For example 401 or 503, in which case the load balancer applies the policy if the error code exactly matches this value. - 5xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 500 to 599. - 4xx: Load Balancer will apply the policy if the backend service responds with any response code in the range of 400 to 499. Values must be unique within matchResponseCodes and across all errorResponseRules of CustomErrorResponsePolicy. + * + * Generated from protobuf field repeated string match_response_codes = 104973410; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMatchResponseCodes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->match_response_codes = $arr; + + return $this; + } + + /** + * The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + * + * Generated from protobuf field optional int32 override_response_code = 530328568; + * @return int + */ + public function getOverrideResponseCode() + { + return isset($this->override_response_code) ? $this->override_response_code : 0; + } + + public function hasOverrideResponseCode() + { + return isset($this->override_response_code); + } + + public function clearOverrideResponseCode() + { + unset($this->override_response_code); + } + + /** + * The HTTP status code returned with the response containing the custom error content. If overrideResponseCode is not supplied, the same response code returned by the original backend bucket or backend service is returned to the client. + * + * Generated from protobuf field optional int32 override_response_code = 530328568; + * @param int $var + * @return $this + */ + public function setOverrideResponseCode($var) + { + GPBUtil::checkInt32($var); + $this->override_response_code = $var; + + return $this; + } + + /** + * The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters + * + * 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); + } + + /** + * The full path to a file within backendBucket . For example: /errors/defaultError.html path must start with a leading slash. path cannot have trailing slashes. If the file is not available in backendBucket or the load balancer cannot reach the BackendBucket, a simple Not Found Error is returned to the client. The value must be from 1 to 1024 characters + * + * 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/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..3dbc7cde41f3 --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..7df4dcdd349c --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..e96f80d5c5ed --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..648e8e45b66b --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..10d3af32a934 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk.php @@ -0,0 +1,2165 @@ +google.cloud.compute.v1.Disk + */ +class Disk extends \Google\Protobuf\Internal\Message +{ + /** + * The access mode of the disk. - READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. - READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can be attached to multiple instances in RO mode. The AccessMode is only valid for Hyperdisk disk types. + * Check the AccessMode enum for the list of possible values. + * + * Generated from protobuf field optional string access_mode = 41155486; + */ + protected $access_mode = null; + /** + * 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 $access_mode + * The access mode of the disk. - READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. - READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can be attached to multiple instances in RO mode. The AccessMode is only valid for Hyperdisk disk types. + * Check the AccessMode enum for the list of possible values. + * @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 access mode of the disk. - READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. - READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can be attached to multiple instances in RO mode. The AccessMode is only valid for Hyperdisk disk types. + * Check the AccessMode enum for the list of possible values. + * + * Generated from protobuf field optional string access_mode = 41155486; + * @return string + */ + public function getAccessMode() + { + return isset($this->access_mode) ? $this->access_mode : ''; + } + + public function hasAccessMode() + { + return isset($this->access_mode); + } + + public function clearAccessMode() + { + unset($this->access_mode); + } + + /** + * The access mode of the disk. - READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. - READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. - READ_ONLY_MANY: The AccessMode means the disk can be attached to multiple instances in RO mode. The AccessMode is only valid for Hyperdisk disk types. + * Check the AccessMode enum for the list of possible values. + * + * Generated from protobuf field optional string access_mode = 41155486; + * @param string $var + * @return $this + */ + public function setAccessMode($var) + { + GPBUtil::checkString($var, True); + $this->access_mode = $var; + + return $this; + } + + /** + * 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/AccessMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/AccessMode.php new file mode 100644 index 000000000000..cbb6e3b4b2ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Disk/AccessMode.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.Disk.AccessMode + */ +class AccessMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ACCESS_MODE = 0; + */ + const UNDEFINED_ACCESS_MODE = 0; + /** + * The AccessMode means the disk can be attached to multiple instances in RO mode. + * + * Generated from protobuf enum READ_ONLY_MANY = 63460265; + */ + const READ_ONLY_MANY = 63460265; + /** + * The AccessMode means the disk can be attached to multiple instances in RW mode. + * + * Generated from protobuf enum READ_WRITE_MANY = 488743208; + */ + const READ_WRITE_MANY = 488743208; + /** + * The default AccessMode, means the disk can be attached to single instance in RW mode. + * + * Generated from protobuf enum READ_WRITE_SINGLE = 99323089; + */ + const READ_WRITE_SINGLE = 99323089; + + private static $valueToName = [ + self::UNDEFINED_ACCESS_MODE => 'UNDEFINED_ACCESS_MODE', + self::READ_ONLY_MANY => 'READ_ONLY_MANY', + self::READ_WRITE_MANY => 'READ_WRITE_MANY', + self::READ_WRITE_SINGLE => 'READ_WRITE_SINGLE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AccessMode::class, \Google\Cloud\Compute\V1\Disk_AccessMode::class); + 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..00606248f6ca --- /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 for firewall rules are: "allow", "deny", "apply_security_profile_group" and "goto_next". Valid actions for packet mirroring rules are: "mirror", "do_not_mirror" 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. Returns compute#firewallPolicyRule for firewall rules and compute#packetMirroringRule for packet mirroring 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 priority. + * + * 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 is one of 'apply_security_profile_group' or 'mirror'. 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 for firewall rules are: "allow", "deny", "apply_security_profile_group" and "goto_next". Valid actions for packet mirroring rules are: "mirror", "do_not_mirror" 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. Returns compute#firewallPolicyRule for firewall rules and compute#packetMirroringRule for packet mirroring 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 priority. + * @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 is one of 'apply_security_profile_group' or 'mirror'. 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 for firewall rules are: "allow", "deny", "apply_security_profile_group" and "goto_next". Valid actions for packet mirroring rules are: "mirror", "do_not_mirror" 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 for firewall rules are: "allow", "deny", "apply_security_profile_group" and "goto_next". Valid actions for packet mirroring rules are: "mirror", "do_not_mirror" 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. Returns compute#firewallPolicyRule for firewall rules and compute#packetMirroringRule for packet mirroring 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. Returns compute#firewallPolicyRule for firewall rules and compute#packetMirroringRule for packet mirroring 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 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; + } + + /** + * 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 is one of 'apply_security_profile_group' or 'mirror'. 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 is one of 'apply_security_profile_group' or 'mirror'. 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..58fdf66c8f37 --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..b42bafe04471 --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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/GetNetworkProfileRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkProfileRequest.php new file mode 100644 index 000000000000..7f8eb229d320 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GetNetworkProfileRequest.php @@ -0,0 +1,116 @@ +google.cloud.compute.v1.GetNetworkProfileRequest + */ +class GetNetworkProfileRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the network profile to return. + * + * Generated from protobuf field string network_profile = 173112472 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $network_profile = ''; + /** + * 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 $networkProfile Name of the network profile to return. + * + * @return \Google\Cloud\Compute\V1\GetNetworkProfileRequest + * + * @experimental + */ + public static function build(string $project, string $networkProfile): self + { + return (new self()) + ->setProject($project) + ->setNetworkProfile($networkProfile); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $network_profile + * Name of the network profile 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 profile to return. + * + * Generated from protobuf field string network_profile = 173112472 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNetworkProfile() + { + return $this->network_profile; + } + + /** + * Name of the network profile to return. + * + * Generated from protobuf field string network_profile = 173112472 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNetworkProfile($var) + { + GPBUtil::checkString($var, True); + $this->network_profile = $var; + + return $this; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 227560217 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProject() + { + return $this->project; + } + + /** + * Project ID for this request. + * + * Generated from protobuf field string project = 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..4513d7b4b12c --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..21d698d5ccfb --- /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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size. + * + * 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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size. + * @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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size. + * + * 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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size. + * + * 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..c466b176c718 --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..800c5cdf756a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/GuestOsFeature/Type.php @@ -0,0 +1,115 @@ +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 TDX_CAPABLE = 240446133; + */ + const TDX_CAPABLE = 240446133; + /** + * 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::TDX_CAPABLE => 'TDX_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..cdbe78cce766 --- /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 /. Must comply with RFC3986. + * + * 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 /. Must comply with RFC3986. + * @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 /. Must comply with RFC3986. + * + * 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 /. Must comply with RFC3986. + * + * 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..6a41a50abd26 --- /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 /. Must comply with RFC3986. + * + * 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 /. Must comply with RFC3986. + * @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 /. Must comply with RFC3986. + * + * 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 /. Must comply with RFC3986. + * + * 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..6cc30b173595 --- /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 /. Must comply with RFC3986. + * + * 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 /. Must comply with RFC3986. + * @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 /. Must comply with RFC3986. + * + * 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 /. Must comply with RFC3986. + * + * 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..dfb4815d27f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthCheck.php @@ -0,0 +1,865 @@ +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; + /** + * The list of cloud regions from which health checks are performed. If any regions are specified, then exactly 3 regions should be specified. The region names must be valid names of Google Cloud regions. This can only be set for global health check. If this list is non-empty, then there are restrictions on what other health check fields are supported and what other resources can use this health check: - SSL, HTTP2, and GRPC protocols are not supported. - The TCP request field is not supported. - The proxyHeader field for HTTP, HTTPS, and TCP is not supported. - The checkIntervalSec field must be at least 30. - The health check cannot be used with BackendService nor with managed instance group auto-healing. + * + * Generated from protobuf field repeated string source_regions = 405568475; + */ + private $source_regions; + /** + * 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 array|\Google\Protobuf\Internal\RepeatedField $source_regions + * The list of cloud regions from which health checks are performed. If any regions are specified, then exactly 3 regions should be specified. The region names must be valid names of Google Cloud regions. This can only be set for global health check. If this list is non-empty, then there are restrictions on what other health check fields are supported and what other resources can use this health check: - SSL, HTTP2, and GRPC protocols are not supported. - The TCP request field is not supported. - The proxyHeader field for HTTP, HTTPS, and TCP is not supported. - The checkIntervalSec field must be at least 30. - The health check cannot be used with BackendService nor with managed instance group auto-healing. + * @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; + } + + /** + * The list of cloud regions from which health checks are performed. If any regions are specified, then exactly 3 regions should be specified. The region names must be valid names of Google Cloud regions. This can only be set for global health check. If this list is non-empty, then there are restrictions on what other health check fields are supported and what other resources can use this health check: - SSL, HTTP2, and GRPC protocols are not supported. - The TCP request field is not supported. - The proxyHeader field for HTTP, HTTPS, and TCP is not supported. - The checkIntervalSec field must be at least 30. - The health check cannot be used with BackendService nor with managed instance group auto-healing. + * + * Generated from protobuf field repeated string source_regions = 405568475; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourceRegions() + { + return $this->source_regions; + } + + /** + * The list of cloud regions from which health checks are performed. If any regions are specified, then exactly 3 regions should be specified. The region names must be valid names of Google Cloud regions. This can only be set for global health check. If this list is non-empty, then there are restrictions on what other health check fields are supported and what other resources can use this health check: - SSL, HTTP2, and GRPC protocols are not supported. - The TCP request field is not supported. - The proxyHeader field for HTTP, HTTPS, and TCP is not supported. - The checkIntervalSec field must be at least 30. - The health check cannot be used with BackendService nor with managed instance group auto-healing. + * + * Generated from protobuf field repeated string source_regions = 405568475; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourceRegions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_regions = $arr; + + 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..c52a3283e79e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus.php @@ -0,0 +1,504 @@ +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; + /** + * Generated from protobuf field optional string ipv6_address = 341563804; + */ + protected $ipv6_address = null; + /** + * Health state of the IPv6 address of the instance. + * Check the Ipv6HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_health_state = 190316614; + */ + protected $ipv6_health_state = 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 string $ipv6_address + * @type string $ipv6_health_state + * Health state of the IPv6 address of the instance. + * Check the Ipv6HealthState enum for the list of possible values. + * @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; + } + + /** + * 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); + } + + /** + * 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; + } + + /** + * Health state of the IPv6 address of the instance. + * Check the Ipv6HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_health_state = 190316614; + * @return string + */ + public function getIpv6HealthState() + { + return isset($this->ipv6_health_state) ? $this->ipv6_health_state : ''; + } + + public function hasIpv6HealthState() + { + return isset($this->ipv6_health_state); + } + + public function clearIpv6HealthState() + { + unset($this->ipv6_health_state); + } + + /** + * Health state of the IPv6 address of the instance. + * Check the Ipv6HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_health_state = 190316614; + * @param string $var + * @return $this + */ + public function setIpv6HealthState($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_health_state = $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..6ef605fa2fa8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/HealthState.php @@ -0,0 +1,63 @@ +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/Ipv6HealthState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/Ipv6HealthState.php new file mode 100644 index 000000000000..6c122ff3f39e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatus/Ipv6HealthState.php @@ -0,0 +1,53 @@ +google.cloud.compute.v1.HealthStatus.Ipv6HealthState + */ +class Ipv6HealthState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IPV6_HEALTH_STATE = 0; + */ + const UNDEFINED_IPV6_HEALTH_STATE = 0; + + private static $valueToName = [ + self::UNDEFINED_IPV6_HEALTH_STATE => 'UNDEFINED_IPV6_HEALTH_STATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6HealthState::class, \Google\Cloud\Compute\V1\HealthStatus_Ipv6HealthState::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..f69fc7281c02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint.php @@ -0,0 +1,304 @@ +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; + /** + * Health state of the ipv6 network endpoint determined based on the health checks configured. + * Check the Ipv6HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_health_state = 190316614; + */ + protected $ipv6_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. + * @type string $ipv6_health_state + * Health state of the ipv6 network endpoint determined based on the health checks configured. + * Check the Ipv6HealthState 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; + } + + /** + * Health state of the ipv6 network endpoint determined based on the health checks configured. + * Check the Ipv6HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_health_state = 190316614; + * @return string + */ + public function getIpv6HealthState() + { + return isset($this->ipv6_health_state) ? $this->ipv6_health_state : ''; + } + + public function hasIpv6HealthState() + { + return isset($this->ipv6_health_state); + } + + public function clearIpv6HealthState() + { + unset($this->ipv6_health_state); + } + + /** + * Health state of the ipv6 network endpoint determined based on the health checks configured. + * Check the Ipv6HealthState enum for the list of possible values. + * + * Generated from protobuf field optional string ipv6_health_state = 190316614; + * @param string $var + * @return $this + */ + public function setIpv6HealthState($var) + { + GPBUtil::checkString($var, True); + $this->ipv6_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..61dbb9fbc478 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/HealthState.php @@ -0,0 +1,75 @@ +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; + /** + * Generated from protobuf enum DRAINING = 480455402; + */ + const DRAINING = 480455402; + /** + * Generated from protobuf enum HEALTHY = 439801213; + */ + const HEALTHY = 439801213; + /** + * Generated from protobuf enum UNHEALTHY = 462118084; + */ + const UNHEALTHY = 462118084; + /** + * 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/HealthStatusForNetworkEndpoint/Ipv6HealthState.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/Ipv6HealthState.php new file mode 100644 index 000000000000..2c09bc151221 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HealthStatusForNetworkEndpoint/Ipv6HealthState.php @@ -0,0 +1,55 @@ +google.cloud.compute.v1.HealthStatusForNetworkEndpoint.Ipv6HealthState + */ +class Ipv6HealthState +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_IPV6_HEALTH_STATE = 0; + */ + const UNDEFINED_IPV6_HEALTH_STATE = 0; + + private static $valueToName = [ + self::UNDEFINED_IPV6_HEALTH_STATE => 'UNDEFINED_IPV6_HEALTH_STATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Ipv6HealthState::class, \Google\Cloud\Compute\V1\HealthStatusForNetworkEndpoint_Ipv6HealthState::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..d8fb6b73ed0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/HttpRouteRule.php @@ -0,0 +1,375 @@ +google.cloud.compute.v1.HttpRouteRule + */ +class HttpRouteRule extends \Google\Protobuf\Internal\Message +{ + /** + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the RouteRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with routeRules.routeAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the customErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the customErrorResponsePolicy is ignored and the response from the service is returned to the client. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619; + */ + protected $custom_error_response_policy = null; + /** + * 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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 \Google\Cloud\Compute\V1\CustomErrorResponsePolicy $custom_error_response_policy + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the RouteRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with routeRules.routeAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the customErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the customErrorResponsePolicy is ignored and the response from the service is returned to the client. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * @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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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); + } + + /** + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the RouteRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with routeRules.routeAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the customErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the customErrorResponsePolicy is ignored and the response from the service is returned to the client. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619; + * @return \Google\Cloud\Compute\V1\CustomErrorResponsePolicy|null + */ + public function getCustomErrorResponsePolicy() + { + return $this->custom_error_response_policy; + } + + public function hasCustomErrorResponsePolicy() + { + return isset($this->custom_error_response_policy); + } + + public function clearCustomErrorResponsePolicy() + { + unset($this->custom_error_response_policy); + } + + /** + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the RouteRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with routeRules.routeAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the customErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the customErrorResponsePolicy is ignored and the response from the service is returned to the client. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619; + * @param \Google\Cloud\Compute\V1\CustomErrorResponsePolicy $var + * @return $this + */ + public function setCustomErrorResponsePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomErrorResponsePolicy::class); + $this->custom_error_response_policy = $var; + + return $this; + } + + /** + * 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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..34cdfafb79ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManager.php @@ -0,0 +1,1361 @@ +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 is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern [a-z](([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\[[0-9]{1,10}\\])?)) + * + * 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; + /** + * Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerInstanceFlexibilityPolicy instance_flexibility_policy = 26937090; + */ + protected $instance_flexibility_policy = 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; + /** + * [Output Only] Named ports configured on 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] 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] 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; + /** + * Standby policy for stopped and suspended instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStandbyPolicy standby_policy = 499352324; + */ + protected $standby_policy = 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 target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method. + * + * Generated from protobuf field optional int32 target_stopped_size = 2419489; + */ + protected $target_stopped_size = null; + /** + * The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method. + * + * Generated from protobuf field optional int32 target_suspended_size = 308085843; + */ + protected $target_suspended_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 is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern [a-z](([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\[[0-9]{1,10}\\])?)) + * @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 \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceFlexibilityPolicy $instance_flexibility_policy + * Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration. + * @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 + * [Output Only] Named ports configured on 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 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] The URL for this managed instance group. The server defines this URL. + * @type \Google\Cloud\Compute\V1\InstanceGroupManagerStandbyPolicy $standby_policy + * Standby policy for stopped and suspended instances. + * @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 int $target_stopped_size + * The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method. + * @type int $target_suspended_size + * The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method. + * @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 is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern [a-z](([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\[[0-9]{1,10}\\])?)) + * + * 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 is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern [a-z](([-a-z0-9]{0,57})|([-a-z0-9]{0,51}-#{1,10}(\\[[0-9]{1,10}\\])?)) + * + * 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; + } + + /** + * Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerInstanceFlexibilityPolicy instance_flexibility_policy = 26937090; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceFlexibilityPolicy|null + */ + public function getInstanceFlexibilityPolicy() + { + return $this->instance_flexibility_policy; + } + + public function hasInstanceFlexibilityPolicy() + { + return isset($this->instance_flexibility_policy); + } + + public function clearInstanceFlexibilityPolicy() + { + unset($this->instance_flexibility_policy); + } + + /** + * Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerInstanceFlexibilityPolicy instance_flexibility_policy = 26937090; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceFlexibilityPolicy $var + * @return $this + */ + public function setInstanceFlexibilityPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceFlexibilityPolicy::class); + $this->instance_flexibility_policy = $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; + } + + /** + * [Output Only] Named ports configured on 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; + } + + /** + * [Output Only] Named ports configured on 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] 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] 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; + } + + /** + * Standby policy for stopped and suspended instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStandbyPolicy standby_policy = 499352324; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagerStandbyPolicy|null + */ + public function getStandbyPolicy() + { + return $this->standby_policy; + } + + public function hasStandbyPolicy() + { + return isset($this->standby_policy); + } + + public function clearStandbyPolicy() + { + unset($this->standby_policy); + } + + /** + * Standby policy for stopped and suspended instances. + * + * Generated from protobuf field optional .google.cloud.compute.v1.InstanceGroupManagerStandbyPolicy standby_policy = 499352324; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagerStandbyPolicy $var + * @return $this + */ + public function setStandbyPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagerStandbyPolicy::class); + $this->standby_policy = $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 target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method. + * + * Generated from protobuf field optional int32 target_stopped_size = 2419489; + * @return int + */ + public function getTargetStoppedSize() + { + return isset($this->target_stopped_size) ? $this->target_stopped_size : 0; + } + + public function hasTargetStoppedSize() + { + return isset($this->target_stopped_size); + } + + public function clearTargetStoppedSize() + { + unset($this->target_stopped_size); + } + + /** + * The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method. + * + * Generated from protobuf field optional int32 target_stopped_size = 2419489; + * @param int $var + * @return $this + */ + public function setTargetStoppedSize($var) + { + GPBUtil::checkInt32($var); + $this->target_stopped_size = $var; + + return $this; + } + + /** + * The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method. + * + * Generated from protobuf field optional int32 target_suspended_size = 308085843; + * @return int + */ + public function getTargetSuspendedSize() + { + return isset($this->target_suspended_size) ? $this->target_suspended_size : 0; + } + + public function hasTargetSuspendedSize() + { + return isset($this->target_suspended_size); + } + + public function clearTargetSuspendedSize() + { + unset($this->target_suspended_size); + } + + /** + * The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method. + * + * Generated from protobuf field optional int32 target_suspended_size = 308085843; + * @param int $var + * @return $this + */ + public function setTargetSuspendedSize($var) + { + GPBUtil::checkInt32($var); + $this->target_suspended_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/InstanceGroupManagerInstanceFlexibilityPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceFlexibilityPolicy.php new file mode 100644 index 000000000000..db544835c61d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceFlexibilityPolicy.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupManagerInstanceFlexibilityPolicy + */ +class InstanceGroupManagerInstanceFlexibilityPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Named instance selections configuring properties that the group will use when creating new VMs. + * + * Generated from protobuf field map instance_selections = 22954577; + */ + private $instance_selections; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $instance_selections + * Named instance selections configuring properties that the group will use when creating new VMs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Named instance selections configuring properties that the group will use when creating new VMs. + * + * Generated from protobuf field map instance_selections = 22954577; + * @return \Google\Protobuf\Internal\MapField + */ + public function getInstanceSelections() + { + return $this->instance_selections; + } + + /** + * Named instance selections configuring properties that the group will use when creating new VMs. + * + * Generated from protobuf field map instance_selections = 22954577; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setInstanceSelections($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection::class); + $this->instance_selections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection.php new file mode 100644 index 000000000000..baaa77e1cddf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection + */ +class InstanceGroupManagerInstanceFlexibilityPolicyInstanceSelection extends \Google\Protobuf\Internal\Message +{ + /** + * Full machine-type names, e.g. "n1-standard-16". + * + * Generated from protobuf field repeated string machine_types = 79720065; + */ + private $machine_types; + /** + * Preference of this instance selection. Lower number means higher preference. MIG will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + * + * Generated from protobuf field optional int32 rank = 3492908; + */ + protected $rank = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $machine_types + * Full machine-type names, e.g. "n1-standard-16". + * @type int $rank + * Preference of this instance selection. Lower number means higher preference. MIG will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Full machine-type names, e.g. "n1-standard-16". + * + * Generated from protobuf field repeated string machine_types = 79720065; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMachineTypes() + { + return $this->machine_types; + } + + /** + * Full machine-type names, e.g. "n1-standard-16". + * + * Generated from protobuf field repeated string machine_types = 79720065; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMachineTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->machine_types = $arr; + + return $this; + } + + /** + * Preference of this instance selection. Lower number means higher preference. MIG will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + * + * Generated from protobuf field optional int32 rank = 3492908; + * @return int + */ + public function getRank() + { + return isset($this->rank) ? $this->rank : 0; + } + + public function hasRank() + { + return isset($this->rank); + } + + public function clearRank() + { + unset($this->rank); + } + + /** + * Preference of this instance selection. Lower number means higher preference. MIG will first try to create a VM based on the machine-type with lowest rank and fallback to next rank based on availability. Machine types and instance selections with the same rank have the same preference. + * + * Generated from protobuf field optional int32 rank = 3492908; + * @param int $var + * @return $this + */ + public function setRank($var) + { + GPBUtil::checkInt32($var); + $this->rank = $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..bb2173ac76b9 --- /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. This field cannot be used together with 'instances'. + * + * 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. This field cannot be used together with 'instances'. + * @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. This field cannot be used together with 'instances'. + * + * 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. This field cannot be used together with 'instances'. + * + * 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/InstanceGroupManagerStandbyPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStandbyPolicy.php new file mode 100644 index 000000000000..fa3377d50828 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStandbyPolicy.php @@ -0,0 +1,124 @@ +google.cloud.compute.v1.InstanceGroupManagerStandbyPolicy + */ +class InstanceGroupManagerStandbyPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. 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; + /** + * Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. The default mode is `MANUAL`. + * 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 $initial_delay_sec + * Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0. + * @type string $mode + * Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. The default mode is `MANUAL`. + * 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); + } + + /** + * Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. 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); + } + + /** + * Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. 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; + } + + /** + * Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. The default mode is `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); + } + + /** + * Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. The default mode is `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; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStandbyPolicy/Mode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStandbyPolicy/Mode.php new file mode 100644 index 000000000000..e57b1739de09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagerStandbyPolicy/Mode.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.InstanceGroupManagerStandbyPolicy.Mode + */ +class Mode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_MODE = 0; + */ + const UNDEFINED_MODE = 0; + /** + * MIG does not automatically resume or start VMs in the standby pool when the group scales out. + * + * Generated from protobuf enum MANUAL = 119397318; + */ + const MANUAL = 119397318; + /** + * MIG automatically resumes or starts VMs in the standby pool when the group scales out, and replenishes the standby pool afterwards. + * + * Generated from protobuf enum SCALE_OUT_POOL = 635394; + */ + const SCALE_OUT_POOL = 635394; + + private static $valueToName = [ + self::UNDEFINED_MODE => 'UNDEFINED_MODE', + self::MANUAL => 'MANUAL', + self::SCALE_OUT_POOL => 'SCALE_OUT_POOL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no 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\InstanceGroupManagerStandbyPolicy_Mode::class); + 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/InstanceGroupManagersResumeInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersResumeInstancesRequest.php new file mode 100644 index 000000000000..470393eb1122 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersResumeInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupManagersResumeInstancesRequest + */ +class InstanceGroupManagersResumeInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to resume. 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 resume. 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 resume. 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 resume. 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/InstanceGroupManagersStartInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersStartInstancesRequest.php new file mode 100644 index 000000000000..a38f91434316 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersStartInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.InstanceGroupManagersStartInstancesRequest + */ +class InstanceGroupManagersStartInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to start. 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 start. 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 start. 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 start. 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/InstanceGroupManagersStopInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersStopInstancesRequest.php new file mode 100644 index 000000000000..cf374062071d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersStopInstancesRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersStopInstancesRequest + */ +class InstanceGroupManagersStopInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_stop = 134762710; + */ + protected $force_stop = null; + /** + * The URLs of one or more instances to stop. 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 bool $force_stop + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to stop. 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); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_stop = 134762710; + * @return bool + */ + public function getForceStop() + { + return isset($this->force_stop) ? $this->force_stop : false; + } + + public function hasForceStop() + { + return isset($this->force_stop); + } + + public function clearForceStop() + { + unset($this->force_stop); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_stop = 134762710; + * @param bool $var + * @return $this + */ + public function setForceStop($var) + { + GPBUtil::checkBool($var); + $this->force_stop = $var; + + return $this; + } + + /** + * The URLs of one or more instances to stop. 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 stop. 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/InstanceGroupManagersSuspendInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSuspendInstancesRequest.php new file mode 100644 index 000000000000..ec96f9adbbe2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstanceGroupManagersSuspendInstancesRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.InstanceGroupManagersSuspendInstancesRequest + */ +class InstanceGroupManagersSuspendInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_suspend = 27637480; + */ + protected $force_suspend = null; + /** + * The URLs of one or more instances to suspend. 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 bool $force_suspend + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to suspend. 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); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_suspend = 27637480; + * @return bool + */ + public function getForceSuspend() + { + return isset($this->force_suspend) ? $this->force_suspend : false; + } + + public function hasForceSuspend() + { + return isset($this->force_suspend); + } + + public function clearForceSuspend() + { + unset($this->force_suspend); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_suspend = 27637480; + * @param bool $var + * @return $this + */ + public function setForceSuspend($var) + { + GPBUtil::checkBool($var); + $this->force_suspend = $var; + + return $this; + } + + /** + * The URLs of one or more instances to suspend. 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 suspend. 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/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..b59acc9001fb --- /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. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`. + * + * 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. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`. + * @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. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`. + * + * 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. This field only accepts a machine type name, for example `n2-standard-4`. If you use the machine type full or partial URL, for example `projects/my-l7ilb-project/zones/us-central1-a/machineTypes/n2-standard-4`, the request will result in an `INTERNAL_ERROR`. + * + * 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..765e1dc39e0f --- /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 +{ + /** + * [Output Only] 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 + * [Output Only] 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); + } + + /** + * [Output Only] 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; + } + + /** + * [Output Only] 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..be435afce64d --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php @@ -0,0 +1,290 @@ +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; + /** + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * [Output Only] The rules that apply to the instance. Only rules that target the specific VM instance are returned if target service accounts or target secure tags are specified in the rules. + * + * 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 int $priority + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * [Output Only] The rules that apply to the instance. Only rules that target the specific VM instance are returned if target service accounts or target secure tags are specified in the rules. + * @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; + } + + /** + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * + * 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); + } + + /** + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * + * 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] The rules that apply to the instance. Only rules that target the specific VM instance are returned if target service accounts or target secure tags are specified in the rules. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.FirewallPolicyRule rules = 108873975; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * [Output Only] The rules that apply to the instance. Only rules that target the specific VM instance are returned if target service accounts or target secure tags are specified in the rules. + * + * 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..c253bc1f8228 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php @@ -0,0 +1,80 @@ +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 SYSTEM_GLOBAL = 60099507; + */ + const SYSTEM_GLOBAL = 60099507; + /** + * Generated from protobuf enum SYSTEM_REGIONAL = 161777199; + */ + const SYSTEM_REGIONAL = 161777199; + /** + * 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::SYSTEM_GLOBAL => 'SYSTEM_GLOBAL', + self::SYSTEM_REGIONAL => 'SYSTEM_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..b53535a5db08 --- /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: - IF_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: - IF_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: - IF_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: - IF_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: - IF_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: - IF_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: - IF_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: - IF_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..859f58234019 --- /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: - IF_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: - IF_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: - IF_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: - IF_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..17e759d47fce --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/License.php @@ -0,0 +1,473 @@ +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; + /** + * [Input Only] Deprecated. + * + * 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 + * [Input Only] Deprecated. + * @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; + } + + /** + * [Input Only] Deprecated. + * + * 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); + } + + /** + * [Input Only] Deprecated. + * + * 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..7ddcf0591af2 --- /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 +{ + /** + * [Input Only] Deprecated. This field no longer reflects the minimum number of guest cpus required to use the Instance. + * + * Generated from protobuf field optional int32 min_guest_cpu_count = 477964836; + */ + protected $min_guest_cpu_count = null; + /** + * [Input Only] Deprecated. This field no longer reflects the minimum memory required to use the Instance. + * + * 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 + * [Input Only] Deprecated. This field no longer reflects the minimum number of guest cpus required to use the Instance. + * @type int $min_memory_mb + * [Input Only] Deprecated. This field no longer reflects the minimum memory required to use the Instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * [Input Only] Deprecated. This field no longer reflects the minimum number of guest cpus required to use the Instance. + * + * 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); + } + + /** + * [Input Only] Deprecated. This field no longer reflects the minimum number of guest cpus required to use the Instance. + * + * 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; + } + + /** + * [Input Only] Deprecated. This field no longer reflects the minimum memory required to use the Instance. + * + * 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); + } + + /** + * [Input Only] Deprecated. This field no longer reflects the minimum memory required to use the Instance. + * + * 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/ListNetworkProfilesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkProfilesRequest.php new file mode 100644 index 000000000000..48833fae6b18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ListNetworkProfilesRequest.php @@ -0,0 +1,300 @@ +google.cloud.compute.v1.ListNetworkProfilesRequest + */ +class ListNetworkProfilesRequest 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\ListNetworkProfilesRequest + * + * @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/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..aab0a4fea8ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType.php @@ -0,0 +1,765 @@ +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] The architecture of the machine type. + * 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; + /** + * [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 $architecture + * [Output Only] The architecture of the machine type. + * Check the Architecture enum for the list of possible values. + * @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] The architecture of the machine type. + * 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 machine type. + * 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; + } + + /** + * [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/MachineType/Architecture.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType/Architecture.php new file mode 100644 index 000000000000..976b55dbb123 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/MachineType/Architecture.php @@ -0,0 +1,71 @@ +google.cloud.compute.v1.MachineType.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\MachineType_Architecture::class); + 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..4a8607ea43b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstance.php @@ -0,0 +1,515 @@ +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] Instance properties selected for this instance resulting from InstanceFlexibilityPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstancePropertiesFromFlexibilityPolicy properties_from_flexibility_policy = 155525825; + */ + protected $properties_from_flexibility_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\ManagedInstancePropertiesFromFlexibilityPolicy $properties_from_flexibility_policy + * [Output Only] Instance properties selected for this instance resulting from InstanceFlexibilityPolicy. + * @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] Instance properties selected for this instance resulting from InstanceFlexibilityPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstancePropertiesFromFlexibilityPolicy properties_from_flexibility_policy = 155525825; + * @return \Google\Cloud\Compute\V1\ManagedInstancePropertiesFromFlexibilityPolicy|null + */ + public function getPropertiesFromFlexibilityPolicy() + { + return $this->properties_from_flexibility_policy; + } + + public function hasPropertiesFromFlexibilityPolicy() + { + return isset($this->properties_from_flexibility_policy); + } + + public function clearPropertiesFromFlexibilityPolicy() + { + unset($this->properties_from_flexibility_policy); + } + + /** + * [Output Only] Instance properties selected for this instance resulting from InstanceFlexibilityPolicy. + * + * Generated from protobuf field optional .google.cloud.compute.v1.ManagedInstancePropertiesFromFlexibilityPolicy properties_from_flexibility_policy = 155525825; + * @param \Google\Cloud\Compute\V1\ManagedInstancePropertiesFromFlexibilityPolicy $var + * @return $this + */ + public function setPropertiesFromFlexibilityPolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ManagedInstancePropertiesFromFlexibilityPolicy::class); + $this->properties_from_flexibility_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/ManagedInstancePropertiesFromFlexibilityPolicy.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstancePropertiesFromFlexibilityPolicy.php new file mode 100644 index 000000000000..70c523f2bdd5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ManagedInstancePropertiesFromFlexibilityPolicy.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ManagedInstancePropertiesFromFlexibilityPolicy + */ +class ManagedInstancePropertiesFromFlexibilityPolicy extends \Google\Protobuf\Internal\Message +{ + /** + * The machine type to be used for this instance. + * + * 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 + * The machine type to be used for this instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * The machine type to be used for this instance. + * + * 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 be used for this instance. + * + * 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/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..5aec292e4ac0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Network.php @@ -0,0 +1,853 @@ +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; + /** + * A full or partial URL of the network profile to apply to this network. This field can be set only at resource creation time. For example, the following are valid URLs: - https://www.googleapis.com/compute/{api_version}/projects/{project_id}/global/networkProfiles/{network_profile_name} - projects/{project_id}/global/networkProfiles/{network_profile_name} + * + * Generated from protobuf field optional string network_profile = 173112472; + */ + protected $network_profile = 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 string $network_profile + * A full or partial URL of the network profile to apply to this network. This field can be set only at resource creation time. For example, the following are valid URLs: - https://www.googleapis.com/compute/{api_version}/projects/{project_id}/global/networkProfiles/{network_profile_name} - projects/{project_id}/global/networkProfiles/{network_profile_name} + * @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; + } + + /** + * A full or partial URL of the network profile to apply to this network. This field can be set only at resource creation time. For example, the following are valid URLs: - https://www.googleapis.com/compute/{api_version}/projects/{project_id}/global/networkProfiles/{network_profile_name} - projects/{project_id}/global/networkProfiles/{network_profile_name} + * + * Generated from protobuf field optional string network_profile = 173112472; + * @return string + */ + public function getNetworkProfile() + { + return isset($this->network_profile) ? $this->network_profile : ''; + } + + public function hasNetworkProfile() + { + return isset($this->network_profile); + } + + public function clearNetworkProfile() + { + unset($this->network_profile); + } + + /** + * A full or partial URL of the network profile to apply to this network. This field can be set only at resource creation time. For example, the following are valid URLs: - https://www.googleapis.com/compute/{api_version}/projects/{project_id}/global/networkProfiles/{network_profile_name} - projects/{project_id}/global/networkProfiles/{network_profile_name} + * + * Generated from protobuf field optional string network_profile = 173112472; + * @param string $var + * @return $this + */ + public function setNetworkProfile($var) + { + GPBUtil::checkString($var, True); + $this->network_profile = $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..0cc1bd594808 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpoint.php @@ -0,0 +1,331 @@ +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; + /** + * Represents the port number to which PSC consumer sends packets. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type. + * + * Generated from protobuf field optional int32 client_destination_port = 123765766; + */ + protected $client_destination_port = null; + /** + * 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 IPv6 address of network endpoint. + * + * Generated from protobuf field optional string ipv6_address = 341563804; + */ + protected $ipv6_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 int $client_destination_port + * Represents the port number to which PSC consumer sends packets. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type. + * @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 string $ipv6_address + * Optional IPv6 address of network endpoint. + * @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; + } + + /** + * Represents the port number to which PSC consumer sends packets. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type. + * + * Generated from protobuf field optional int32 client_destination_port = 123765766; + * @return int + */ + public function getClientDestinationPort() + { + return isset($this->client_destination_port) ? $this->client_destination_port : 0; + } + + public function hasClientDestinationPort() + { + return isset($this->client_destination_port); + } + + public function clearClientDestinationPort() + { + unset($this->client_destination_port); + } + + /** + * Represents the port number to which PSC consumer sends packets. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type. + * + * Generated from protobuf field optional int32 client_destination_port = 123765766; + * @param int $var + * @return $this + */ + public function setClientDestinationPort($var) + { + GPBUtil::checkInt32($var); + $this->client_destination_port = $var; + + 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 IPv6 address of network endpoint. + * + * 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); + } + + /** + * Optional IPv6 address of network endpoint. + * + * 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; + } + + /** + * 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..05d2a166fedf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroup/NetworkEndpointType.php @@ -0,0 +1,106 @@ +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 an IP, Port and Client Destination Port. + * + * Generated from protobuf enum GCE_VM_IP_PORTMAP = 22819253; + */ + const GCE_VM_IP_PORTMAP = 22819253; + /** + * 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::GCE_VM_IP_PORTMAP => 'GCE_VM_IP_PORTMAP', + 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..ce05b8f2ab25 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkEndpointGroupPscData.php @@ -0,0 +1,213 @@ +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; + /** + * The psc producer port is used to connect PSC NEG with specific port on the PSC Producer side; should only be used for the PRIVATE_SERVICE_CONNECT NEG type + * + * Generated from protobuf field optional int32 producer_port = 410021134; + */ + protected $producer_port = 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 $producer_port + * The psc producer port is used to connect PSC NEG with specific port on the PSC Producer side; should only be used for the PRIVATE_SERVICE_CONNECT NEG type + * @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; + } + + /** + * The psc producer port is used to connect PSC NEG with specific port on the PSC Producer side; should only be used for the PRIVATE_SERVICE_CONNECT NEG type + * + * Generated from protobuf field optional int32 producer_port = 410021134; + * @return int + */ + public function getProducerPort() + { + return isset($this->producer_port) ? $this->producer_port : 0; + } + + public function hasProducerPort() + { + return isset($this->producer_port); + } + + public function clearProducerPort() + { + unset($this->producer_port); + } + + /** + * The psc producer port is used to connect PSC NEG with specific port on the PSC Producer side; should only be used for the PRIVATE_SERVICE_CONNECT NEG type + * + * Generated from protobuf field optional int32 producer_port = 410021134; + * @param int $var + * @return $this + */ + public function setProducerPort($var) + { + GPBUtil::checkInt32($var); + $this->producer_port = $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..dfb43ce917e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/NicType.php @@ -0,0 +1,92 @@ +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; + /** + * IDPF + * + * Generated from protobuf enum IDPF = 2242641; + */ + const IDPF = 2242641; + /** + * IRDMA + * + * Generated from protobuf enum IRDMA = 69927695; + */ + const IRDMA = 69927695; + /** + * MRDMA + * + * Generated from protobuf enum MRDMA = 73621779; + */ + const MRDMA = 73621779; + /** + * 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::IDPF => 'IDPF', + self::IRDMA => 'IRDMA', + self::MRDMA => 'MRDMA', + 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..d09d94b4dd1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkInterface/StackType.php @@ -0,0 +1,76 @@ +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 only be assigned IPv4 addresses. + * + * Generated from protobuf enum IPV4_ONLY = 22373798; + */ + const IPV4_ONLY = 22373798; + /** + * The network interface will only be assigned IPv6 addresses. + * + * Generated from protobuf enum IPV6_ONLY = 79632100; + */ + const IPV6_ONLY = 79632100; + /** + * 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::IPV6_ONLY => 'IPV6_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/NetworkProfile.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfile.php new file mode 100644 index 000000000000..dd9868397bc0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfile.php @@ -0,0 +1,473 @@ +google.cloud.compute.v1.NetworkProfile + */ +class NetworkProfile 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] An optional description of this resource. + * + * Generated from protobuf field optional string description = 422937596; + */ + protected $description = null; + /** + * [Output Only] Features supported by the network. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkProfileNetworkFeatures features = 246211645; + */ + protected $features = 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#networkProfile for network profiles. + * + * Generated from protobuf field optional string kind = 3292052; + */ + protected $kind = null; + /** + * [Output Only] Location to which the network is restricted. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkProfileLocation location = 290430901; + */ + protected $location = 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] Zone to which the network is restricted. + * + * 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 + * [Output Only] An optional description of this resource. + * @type \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures $features + * [Output Only] Features supported by the network. + * @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#networkProfile for network profiles. + * @type \Google\Cloud\Compute\V1\NetworkProfileLocation $location + * [Output Only] Location to which the network is restricted. + * @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 string $zone + * [Output Only] Zone to which the network is restricted. + * } + */ + 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] 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] Features supported by the network. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkProfileNetworkFeatures features = 246211645; + * @return \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures|null + */ + public function getFeatures() + { + return $this->features; + } + + public function hasFeatures() + { + return isset($this->features); + } + + public function clearFeatures() + { + unset($this->features); + } + + /** + * [Output Only] Features supported by the network. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkProfileNetworkFeatures features = 246211645; + * @param \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures $var + * @return $this + */ + public function setFeatures($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures::class); + $this->features = $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#networkProfile for network profiles. + * + * 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#networkProfile for network profiles. + * + * 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] Location to which the network is restricted. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkProfileLocation location = 290430901; + * @return \Google\Cloud\Compute\V1\NetworkProfileLocation|null + */ + public function getLocation() + { + return $this->location; + } + + public function hasLocation() + { + return isset($this->location); + } + + public function clearLocation() + { + unset($this->location); + } + + /** + * [Output Only] Location to which the network is restricted. + * + * Generated from protobuf field optional .google.cloud.compute.v1.NetworkProfileLocation location = 290430901; + * @param \Google\Cloud\Compute\V1\NetworkProfileLocation $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NetworkProfileLocation::class); + $this->location = $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] Zone to which the network is restricted. + * + * 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] Zone to which the network is restricted. + * + * 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/NetworkProfileLocation.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation.php new file mode 100644 index 000000000000..fc8a1b3bef57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation.php @@ -0,0 +1,117 @@ +google.cloud.compute.v1.NetworkProfileLocation + */ +class NetworkProfileLocation extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field optional string name = 3373707; + */ + protected $name = null; + /** + * + * Check the Scope enum for the list of possible values. + * + * Generated from protobuf field optional string scope = 109264468; + */ + protected $scope = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * @type string $scope + * + * Check the Scope enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * 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); + } + + /** + * 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; + } + + /** + * + * Check the Scope enum for the list of possible values. + * + * Generated from protobuf field optional string scope = 109264468; + * @return string + */ + public function getScope() + { + return isset($this->scope) ? $this->scope : ''; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * + * Check the Scope enum for the list of possible values. + * + * Generated from protobuf field optional string scope = 109264468; + * @param string $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkString($var, True); + $this->scope = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation/Scope.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation/Scope.php new file mode 100644 index 000000000000..7f665f2c81b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileLocation/Scope.php @@ -0,0 +1,59 @@ +google.cloud.compute.v1.NetworkProfileLocation.Scope + */ +class Scope +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SCOPE = 0; + */ + const UNDEFINED_SCOPE = 0; + /** + * Generated from protobuf enum REGION = 266017524; + */ + const REGION = 266017524; + /** + * Generated from protobuf enum ZONE = 2759596; + */ + const ZONE = 2759596; + + private static $valueToName = [ + self::UNDEFINED_SCOPE => 'UNDEFINED_SCOPE', + self::REGION => 'REGION', + self::ZONE => 'ZONE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Scope::class, \Google\Cloud\Compute\V1\NetworkProfileLocation_Scope::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures.php new file mode 100644 index 000000000000..288863bf4271 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures.php @@ -0,0 +1,1048 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures + */ +class NetworkProfileNetworkFeatures extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies what address purposes are supported. If empty, all address purposes are supported. + * Check the AddressPurposes enum for the list of possible values. + * + * Generated from protobuf field repeated string address_purposes = 433024768; + */ + private $address_purposes; + /** + * Specifies whether alias IP ranges (and secondary address ranges) are allowed. + * Check the AllowAliasIpRanges enum for the list of possible values. + * + * Generated from protobuf field optional string allow_alias_ip_ranges = 457984201; + */ + protected $allow_alias_ip_ranges = null; + /** + * Specifies whether auto mode subnet creation is allowed. + * Check the AllowAutoModeSubnet enum for the list of possible values. + * + * Generated from protobuf field optional string allow_auto_mode_subnet = 152191263; + */ + protected $allow_auto_mode_subnet = null; + /** + * Specifies whether firewalls for Class D address ranges are supported. + * Check the AllowClassDFirewalls enum for the list of possible values. + * + * Generated from protobuf field optional string allow_class_d_firewalls = 131608987; + */ + protected $allow_class_d_firewalls = null; + /** + * Specifies whether cloud NAT creation is allowed. + * Check the AllowCloudNat enum for the list of possible values. + * + * Generated from protobuf field optional string allow_cloud_nat = 254831265; + */ + protected $allow_cloud_nat = null; + /** + * Specifies whether cloud router creation is allowed. + * Check the AllowCloudRouter enum for the list of possible values. + * + * Generated from protobuf field optional string allow_cloud_router = 451110345; + */ + protected $allow_cloud_router = null; + /** + * Specifies whether VMs are allowed to have external IP access on network interfaces connected to this VPC. + * Check the AllowExternalIpAccess enum for the list of possible values. + * + * Generated from protobuf field optional string allow_external_ip_access = 131538110; + */ + protected $allow_external_ip_access = null; + /** + * Specifies whether Cloud Interconnect creation is allowed. + * Check the AllowInterconnect enum for the list of possible values. + * + * Generated from protobuf field optional string allow_interconnect = 280512964; + */ + protected $allow_interconnect = null; + /** + * Specifies whether cloud load balancing is allowed. + * Check the AllowLoadBalancing enum for the list of possible values. + * + * Generated from protobuf field optional string allow_load_balancing = 223366198; + */ + protected $allow_load_balancing = null; + /** + * Specifies whether multi-nic in the same network is allowed. + * Check the AllowMultiNicInSameNetwork enum for the list of possible values. + * + * Generated from protobuf field optional string allow_multi_nic_in_same_network = 88251004; + */ + protected $allow_multi_nic_in_same_network = null; + /** + * Specifies whether Packet Mirroring 1.0 is supported. + * Check the AllowPacketMirroring enum for the list of possible values. + * + * Generated from protobuf field optional string allow_packet_mirroring = 512227074; + */ + protected $allow_packet_mirroring = null; + /** + * Specifies whether private Google access is allowed. + * Check the AllowPrivateGoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string allow_private_google_access = 374702072; + */ + protected $allow_private_google_access = null; + /** + * Specifies whether PSC creation is allowed. + * Check the AllowPsc enum for the list of possible values. + * + * Generated from protobuf field optional string allow_psc = 372357322; + */ + protected $allow_psc = null; + /** + * Specifies whether unicast within the same network is allowed. + * Check the AllowSameNetworkUnicast enum for the list of possible values. + * + * Generated from protobuf field optional string allow_same_network_unicast = 167531643; + */ + protected $allow_same_network_unicast = null; + /** + * Specifies whether static route creation is allowed. + * Check the AllowStaticRoutes enum for the list of possible values. + * + * Generated from protobuf field optional string allow_static_routes = 185257925; + */ + protected $allow_static_routes = null; + /** + * Specifies whether sub interfaces are allowed. + * Check the AllowSubInterfaces enum for the list of possible values. + * + * Generated from protobuf field optional string allow_sub_interfaces = 247208303; + */ + protected $allow_sub_interfaces = null; + /** + * Specifies whether VPC peering is allowed. + * Check the AllowVpcPeering enum for the list of possible values. + * + * Generated from protobuf field optional string allow_vpc_peering = 115402228; + */ + protected $allow_vpc_peering = null; + /** + * Specifies whether VPN creation is allowed. + * Check the AllowVpn enum for the list of possible values. + * + * Generated from protobuf field optional string allow_vpn = 372363006; + */ + protected $allow_vpn = null; + /** + * If set, limits the interface types that the network supports. If empty, all interface types are supported. + * Check the InterfaceTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string interface_types = 157981171; + */ + private $interface_types; + /** + * Specifies which subnetwork purposes are supported. + * Check the SubnetPurposes enum for the list of possible values. + * + * Generated from protobuf field repeated string subnet_purposes = 301338039; + */ + private $subnet_purposes; + /** + * Specifies which subnetwork stack types are supported. + * Check the SubnetStackTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string subnet_stack_types = 521008672; + */ + private $subnet_stack_types; + /** + * Specifies which type of unicast is supported. + * Check the Unicast enum for the list of possible values. + * + * Generated from protobuf field optional string unicast = 249841711; + */ + protected $unicast = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $address_purposes + * Specifies what address purposes are supported. If empty, all address purposes are supported. + * Check the AddressPurposes enum for the list of possible values. + * @type string $allow_alias_ip_ranges + * Specifies whether alias IP ranges (and secondary address ranges) are allowed. + * Check the AllowAliasIpRanges enum for the list of possible values. + * @type string $allow_auto_mode_subnet + * Specifies whether auto mode subnet creation is allowed. + * Check the AllowAutoModeSubnet enum for the list of possible values. + * @type string $allow_class_d_firewalls + * Specifies whether firewalls for Class D address ranges are supported. + * Check the AllowClassDFirewalls enum for the list of possible values. + * @type string $allow_cloud_nat + * Specifies whether cloud NAT creation is allowed. + * Check the AllowCloudNat enum for the list of possible values. + * @type string $allow_cloud_router + * Specifies whether cloud router creation is allowed. + * Check the AllowCloudRouter enum for the list of possible values. + * @type string $allow_external_ip_access + * Specifies whether VMs are allowed to have external IP access on network interfaces connected to this VPC. + * Check the AllowExternalIpAccess enum for the list of possible values. + * @type string $allow_interconnect + * Specifies whether Cloud Interconnect creation is allowed. + * Check the AllowInterconnect enum for the list of possible values. + * @type string $allow_load_balancing + * Specifies whether cloud load balancing is allowed. + * Check the AllowLoadBalancing enum for the list of possible values. + * @type string $allow_multi_nic_in_same_network + * Specifies whether multi-nic in the same network is allowed. + * Check the AllowMultiNicInSameNetwork enum for the list of possible values. + * @type string $allow_packet_mirroring + * Specifies whether Packet Mirroring 1.0 is supported. + * Check the AllowPacketMirroring enum for the list of possible values. + * @type string $allow_private_google_access + * Specifies whether private Google access is allowed. + * Check the AllowPrivateGoogleAccess enum for the list of possible values. + * @type string $allow_psc + * Specifies whether PSC creation is allowed. + * Check the AllowPsc enum for the list of possible values. + * @type string $allow_same_network_unicast + * Specifies whether unicast within the same network is allowed. + * Check the AllowSameNetworkUnicast enum for the list of possible values. + * @type string $allow_static_routes + * Specifies whether static route creation is allowed. + * Check the AllowStaticRoutes enum for the list of possible values. + * @type string $allow_sub_interfaces + * Specifies whether sub interfaces are allowed. + * Check the AllowSubInterfaces enum for the list of possible values. + * @type string $allow_vpc_peering + * Specifies whether VPC peering is allowed. + * Check the AllowVpcPeering enum for the list of possible values. + * @type string $allow_vpn + * Specifies whether VPN creation is allowed. + * Check the AllowVpn enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $interface_types + * If set, limits the interface types that the network supports. If empty, all interface types are supported. + * Check the InterfaceTypes enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $subnet_purposes + * Specifies which subnetwork purposes are supported. + * Check the SubnetPurposes enum for the list of possible values. + * @type array|\Google\Protobuf\Internal\RepeatedField $subnet_stack_types + * Specifies which subnetwork stack types are supported. + * Check the SubnetStackTypes enum for the list of possible values. + * @type string $unicast + * Specifies which type of unicast is supported. + * Check the Unicast enum for the list of possible values. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies what address purposes are supported. If empty, all address purposes are supported. + * Check the AddressPurposes enum for the list of possible values. + * + * Generated from protobuf field repeated string address_purposes = 433024768; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAddressPurposes() + { + return $this->address_purposes; + } + + /** + * Specifies what address purposes are supported. If empty, all address purposes are supported. + * Check the AddressPurposes enum for the list of possible values. + * + * Generated from protobuf field repeated string address_purposes = 433024768; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAddressPurposes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->address_purposes = $arr; + + return $this; + } + + /** + * Specifies whether alias IP ranges (and secondary address ranges) are allowed. + * Check the AllowAliasIpRanges enum for the list of possible values. + * + * Generated from protobuf field optional string allow_alias_ip_ranges = 457984201; + * @return string + */ + public function getAllowAliasIpRanges() + { + return isset($this->allow_alias_ip_ranges) ? $this->allow_alias_ip_ranges : ''; + } + + public function hasAllowAliasIpRanges() + { + return isset($this->allow_alias_ip_ranges); + } + + public function clearAllowAliasIpRanges() + { + unset($this->allow_alias_ip_ranges); + } + + /** + * Specifies whether alias IP ranges (and secondary address ranges) are allowed. + * Check the AllowAliasIpRanges enum for the list of possible values. + * + * Generated from protobuf field optional string allow_alias_ip_ranges = 457984201; + * @param string $var + * @return $this + */ + public function setAllowAliasIpRanges($var) + { + GPBUtil::checkString($var, True); + $this->allow_alias_ip_ranges = $var; + + return $this; + } + + /** + * Specifies whether auto mode subnet creation is allowed. + * Check the AllowAutoModeSubnet enum for the list of possible values. + * + * Generated from protobuf field optional string allow_auto_mode_subnet = 152191263; + * @return string + */ + public function getAllowAutoModeSubnet() + { + return isset($this->allow_auto_mode_subnet) ? $this->allow_auto_mode_subnet : ''; + } + + public function hasAllowAutoModeSubnet() + { + return isset($this->allow_auto_mode_subnet); + } + + public function clearAllowAutoModeSubnet() + { + unset($this->allow_auto_mode_subnet); + } + + /** + * Specifies whether auto mode subnet creation is allowed. + * Check the AllowAutoModeSubnet enum for the list of possible values. + * + * Generated from protobuf field optional string allow_auto_mode_subnet = 152191263; + * @param string $var + * @return $this + */ + public function setAllowAutoModeSubnet($var) + { + GPBUtil::checkString($var, True); + $this->allow_auto_mode_subnet = $var; + + return $this; + } + + /** + * Specifies whether firewalls for Class D address ranges are supported. + * Check the AllowClassDFirewalls enum for the list of possible values. + * + * Generated from protobuf field optional string allow_class_d_firewalls = 131608987; + * @return string + */ + public function getAllowClassDFirewalls() + { + return isset($this->allow_class_d_firewalls) ? $this->allow_class_d_firewalls : ''; + } + + public function hasAllowClassDFirewalls() + { + return isset($this->allow_class_d_firewalls); + } + + public function clearAllowClassDFirewalls() + { + unset($this->allow_class_d_firewalls); + } + + /** + * Specifies whether firewalls for Class D address ranges are supported. + * Check the AllowClassDFirewalls enum for the list of possible values. + * + * Generated from protobuf field optional string allow_class_d_firewalls = 131608987; + * @param string $var + * @return $this + */ + public function setAllowClassDFirewalls($var) + { + GPBUtil::checkString($var, True); + $this->allow_class_d_firewalls = $var; + + return $this; + } + + /** + * Specifies whether cloud NAT creation is allowed. + * Check the AllowCloudNat enum for the list of possible values. + * + * Generated from protobuf field optional string allow_cloud_nat = 254831265; + * @return string + */ + public function getAllowCloudNat() + { + return isset($this->allow_cloud_nat) ? $this->allow_cloud_nat : ''; + } + + public function hasAllowCloudNat() + { + return isset($this->allow_cloud_nat); + } + + public function clearAllowCloudNat() + { + unset($this->allow_cloud_nat); + } + + /** + * Specifies whether cloud NAT creation is allowed. + * Check the AllowCloudNat enum for the list of possible values. + * + * Generated from protobuf field optional string allow_cloud_nat = 254831265; + * @param string $var + * @return $this + */ + public function setAllowCloudNat($var) + { + GPBUtil::checkString($var, True); + $this->allow_cloud_nat = $var; + + return $this; + } + + /** + * Specifies whether cloud router creation is allowed. + * Check the AllowCloudRouter enum for the list of possible values. + * + * Generated from protobuf field optional string allow_cloud_router = 451110345; + * @return string + */ + public function getAllowCloudRouter() + { + return isset($this->allow_cloud_router) ? $this->allow_cloud_router : ''; + } + + public function hasAllowCloudRouter() + { + return isset($this->allow_cloud_router); + } + + public function clearAllowCloudRouter() + { + unset($this->allow_cloud_router); + } + + /** + * Specifies whether cloud router creation is allowed. + * Check the AllowCloudRouter enum for the list of possible values. + * + * Generated from protobuf field optional string allow_cloud_router = 451110345; + * @param string $var + * @return $this + */ + public function setAllowCloudRouter($var) + { + GPBUtil::checkString($var, True); + $this->allow_cloud_router = $var; + + return $this; + } + + /** + * Specifies whether VMs are allowed to have external IP access on network interfaces connected to this VPC. + * Check the AllowExternalIpAccess enum for the list of possible values. + * + * Generated from protobuf field optional string allow_external_ip_access = 131538110; + * @return string + */ + public function getAllowExternalIpAccess() + { + return isset($this->allow_external_ip_access) ? $this->allow_external_ip_access : ''; + } + + public function hasAllowExternalIpAccess() + { + return isset($this->allow_external_ip_access); + } + + public function clearAllowExternalIpAccess() + { + unset($this->allow_external_ip_access); + } + + /** + * Specifies whether VMs are allowed to have external IP access on network interfaces connected to this VPC. + * Check the AllowExternalIpAccess enum for the list of possible values. + * + * Generated from protobuf field optional string allow_external_ip_access = 131538110; + * @param string $var + * @return $this + */ + public function setAllowExternalIpAccess($var) + { + GPBUtil::checkString($var, True); + $this->allow_external_ip_access = $var; + + return $this; + } + + /** + * Specifies whether Cloud Interconnect creation is allowed. + * Check the AllowInterconnect enum for the list of possible values. + * + * Generated from protobuf field optional string allow_interconnect = 280512964; + * @return string + */ + public function getAllowInterconnect() + { + return isset($this->allow_interconnect) ? $this->allow_interconnect : ''; + } + + public function hasAllowInterconnect() + { + return isset($this->allow_interconnect); + } + + public function clearAllowInterconnect() + { + unset($this->allow_interconnect); + } + + /** + * Specifies whether Cloud Interconnect creation is allowed. + * Check the AllowInterconnect enum for the list of possible values. + * + * Generated from protobuf field optional string allow_interconnect = 280512964; + * @param string $var + * @return $this + */ + public function setAllowInterconnect($var) + { + GPBUtil::checkString($var, True); + $this->allow_interconnect = $var; + + return $this; + } + + /** + * Specifies whether cloud load balancing is allowed. + * Check the AllowLoadBalancing enum for the list of possible values. + * + * Generated from protobuf field optional string allow_load_balancing = 223366198; + * @return string + */ + public function getAllowLoadBalancing() + { + return isset($this->allow_load_balancing) ? $this->allow_load_balancing : ''; + } + + public function hasAllowLoadBalancing() + { + return isset($this->allow_load_balancing); + } + + public function clearAllowLoadBalancing() + { + unset($this->allow_load_balancing); + } + + /** + * Specifies whether cloud load balancing is allowed. + * Check the AllowLoadBalancing enum for the list of possible values. + * + * Generated from protobuf field optional string allow_load_balancing = 223366198; + * @param string $var + * @return $this + */ + public function setAllowLoadBalancing($var) + { + GPBUtil::checkString($var, True); + $this->allow_load_balancing = $var; + + return $this; + } + + /** + * Specifies whether multi-nic in the same network is allowed. + * Check the AllowMultiNicInSameNetwork enum for the list of possible values. + * + * Generated from protobuf field optional string allow_multi_nic_in_same_network = 88251004; + * @return string + */ + public function getAllowMultiNicInSameNetwork() + { + return isset($this->allow_multi_nic_in_same_network) ? $this->allow_multi_nic_in_same_network : ''; + } + + public function hasAllowMultiNicInSameNetwork() + { + return isset($this->allow_multi_nic_in_same_network); + } + + public function clearAllowMultiNicInSameNetwork() + { + unset($this->allow_multi_nic_in_same_network); + } + + /** + * Specifies whether multi-nic in the same network is allowed. + * Check the AllowMultiNicInSameNetwork enum for the list of possible values. + * + * Generated from protobuf field optional string allow_multi_nic_in_same_network = 88251004; + * @param string $var + * @return $this + */ + public function setAllowMultiNicInSameNetwork($var) + { + GPBUtil::checkString($var, True); + $this->allow_multi_nic_in_same_network = $var; + + return $this; + } + + /** + * Specifies whether Packet Mirroring 1.0 is supported. + * Check the AllowPacketMirroring enum for the list of possible values. + * + * Generated from protobuf field optional string allow_packet_mirroring = 512227074; + * @return string + */ + public function getAllowPacketMirroring() + { + return isset($this->allow_packet_mirroring) ? $this->allow_packet_mirroring : ''; + } + + public function hasAllowPacketMirroring() + { + return isset($this->allow_packet_mirroring); + } + + public function clearAllowPacketMirroring() + { + unset($this->allow_packet_mirroring); + } + + /** + * Specifies whether Packet Mirroring 1.0 is supported. + * Check the AllowPacketMirroring enum for the list of possible values. + * + * Generated from protobuf field optional string allow_packet_mirroring = 512227074; + * @param string $var + * @return $this + */ + public function setAllowPacketMirroring($var) + { + GPBUtil::checkString($var, True); + $this->allow_packet_mirroring = $var; + + return $this; + } + + /** + * Specifies whether private Google access is allowed. + * Check the AllowPrivateGoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string allow_private_google_access = 374702072; + * @return string + */ + public function getAllowPrivateGoogleAccess() + { + return isset($this->allow_private_google_access) ? $this->allow_private_google_access : ''; + } + + public function hasAllowPrivateGoogleAccess() + { + return isset($this->allow_private_google_access); + } + + public function clearAllowPrivateGoogleAccess() + { + unset($this->allow_private_google_access); + } + + /** + * Specifies whether private Google access is allowed. + * Check the AllowPrivateGoogleAccess enum for the list of possible values. + * + * Generated from protobuf field optional string allow_private_google_access = 374702072; + * @param string $var + * @return $this + */ + public function setAllowPrivateGoogleAccess($var) + { + GPBUtil::checkString($var, True); + $this->allow_private_google_access = $var; + + return $this; + } + + /** + * Specifies whether PSC creation is allowed. + * Check the AllowPsc enum for the list of possible values. + * + * Generated from protobuf field optional string allow_psc = 372357322; + * @return string + */ + public function getAllowPsc() + { + return isset($this->allow_psc) ? $this->allow_psc : ''; + } + + public function hasAllowPsc() + { + return isset($this->allow_psc); + } + + public function clearAllowPsc() + { + unset($this->allow_psc); + } + + /** + * Specifies whether PSC creation is allowed. + * Check the AllowPsc enum for the list of possible values. + * + * Generated from protobuf field optional string allow_psc = 372357322; + * @param string $var + * @return $this + */ + public function setAllowPsc($var) + { + GPBUtil::checkString($var, True); + $this->allow_psc = $var; + + return $this; + } + + /** + * Specifies whether unicast within the same network is allowed. + * Check the AllowSameNetworkUnicast enum for the list of possible values. + * + * Generated from protobuf field optional string allow_same_network_unicast = 167531643; + * @return string + */ + public function getAllowSameNetworkUnicast() + { + return isset($this->allow_same_network_unicast) ? $this->allow_same_network_unicast : ''; + } + + public function hasAllowSameNetworkUnicast() + { + return isset($this->allow_same_network_unicast); + } + + public function clearAllowSameNetworkUnicast() + { + unset($this->allow_same_network_unicast); + } + + /** + * Specifies whether unicast within the same network is allowed. + * Check the AllowSameNetworkUnicast enum for the list of possible values. + * + * Generated from protobuf field optional string allow_same_network_unicast = 167531643; + * @param string $var + * @return $this + */ + public function setAllowSameNetworkUnicast($var) + { + GPBUtil::checkString($var, True); + $this->allow_same_network_unicast = $var; + + return $this; + } + + /** + * Specifies whether static route creation is allowed. + * Check the AllowStaticRoutes enum for the list of possible values. + * + * Generated from protobuf field optional string allow_static_routes = 185257925; + * @return string + */ + public function getAllowStaticRoutes() + { + return isset($this->allow_static_routes) ? $this->allow_static_routes : ''; + } + + public function hasAllowStaticRoutes() + { + return isset($this->allow_static_routes); + } + + public function clearAllowStaticRoutes() + { + unset($this->allow_static_routes); + } + + /** + * Specifies whether static route creation is allowed. + * Check the AllowStaticRoutes enum for the list of possible values. + * + * Generated from protobuf field optional string allow_static_routes = 185257925; + * @param string $var + * @return $this + */ + public function setAllowStaticRoutes($var) + { + GPBUtil::checkString($var, True); + $this->allow_static_routes = $var; + + return $this; + } + + /** + * Specifies whether sub interfaces are allowed. + * Check the AllowSubInterfaces enum for the list of possible values. + * + * Generated from protobuf field optional string allow_sub_interfaces = 247208303; + * @return string + */ + public function getAllowSubInterfaces() + { + return isset($this->allow_sub_interfaces) ? $this->allow_sub_interfaces : ''; + } + + public function hasAllowSubInterfaces() + { + return isset($this->allow_sub_interfaces); + } + + public function clearAllowSubInterfaces() + { + unset($this->allow_sub_interfaces); + } + + /** + * Specifies whether sub interfaces are allowed. + * Check the AllowSubInterfaces enum for the list of possible values. + * + * Generated from protobuf field optional string allow_sub_interfaces = 247208303; + * @param string $var + * @return $this + */ + public function setAllowSubInterfaces($var) + { + GPBUtil::checkString($var, True); + $this->allow_sub_interfaces = $var; + + return $this; + } + + /** + * Specifies whether VPC peering is allowed. + * Check the AllowVpcPeering enum for the list of possible values. + * + * Generated from protobuf field optional string allow_vpc_peering = 115402228; + * @return string + */ + public function getAllowVpcPeering() + { + return isset($this->allow_vpc_peering) ? $this->allow_vpc_peering : ''; + } + + public function hasAllowVpcPeering() + { + return isset($this->allow_vpc_peering); + } + + public function clearAllowVpcPeering() + { + unset($this->allow_vpc_peering); + } + + /** + * Specifies whether VPC peering is allowed. + * Check the AllowVpcPeering enum for the list of possible values. + * + * Generated from protobuf field optional string allow_vpc_peering = 115402228; + * @param string $var + * @return $this + */ + public function setAllowVpcPeering($var) + { + GPBUtil::checkString($var, True); + $this->allow_vpc_peering = $var; + + return $this; + } + + /** + * Specifies whether VPN creation is allowed. + * Check the AllowVpn enum for the list of possible values. + * + * Generated from protobuf field optional string allow_vpn = 372363006; + * @return string + */ + public function getAllowVpn() + { + return isset($this->allow_vpn) ? $this->allow_vpn : ''; + } + + public function hasAllowVpn() + { + return isset($this->allow_vpn); + } + + public function clearAllowVpn() + { + unset($this->allow_vpn); + } + + /** + * Specifies whether VPN creation is allowed. + * Check the AllowVpn enum for the list of possible values. + * + * Generated from protobuf field optional string allow_vpn = 372363006; + * @param string $var + * @return $this + */ + public function setAllowVpn($var) + { + GPBUtil::checkString($var, True); + $this->allow_vpn = $var; + + return $this; + } + + /** + * If set, limits the interface types that the network supports. If empty, all interface types are supported. + * Check the InterfaceTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string interface_types = 157981171; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInterfaceTypes() + { + return $this->interface_types; + } + + /** + * If set, limits the interface types that the network supports. If empty, all interface types are supported. + * Check the InterfaceTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string interface_types = 157981171; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInterfaceTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->interface_types = $arr; + + return $this; + } + + /** + * Specifies which subnetwork purposes are supported. + * Check the SubnetPurposes enum for the list of possible values. + * + * Generated from protobuf field repeated string subnet_purposes = 301338039; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetPurposes() + { + return $this->subnet_purposes; + } + + /** + * Specifies which subnetwork purposes are supported. + * Check the SubnetPurposes enum for the list of possible values. + * + * Generated from protobuf field repeated string subnet_purposes = 301338039; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetPurposes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subnet_purposes = $arr; + + return $this; + } + + /** + * Specifies which subnetwork stack types are supported. + * Check the SubnetStackTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string subnet_stack_types = 521008672; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSubnetStackTypes() + { + return $this->subnet_stack_types; + } + + /** + * Specifies which subnetwork stack types are supported. + * Check the SubnetStackTypes enum for the list of possible values. + * + * Generated from protobuf field repeated string subnet_stack_types = 521008672; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSubnetStackTypes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->subnet_stack_types = $arr; + + return $this; + } + + /** + * Specifies which type of unicast is supported. + * Check the Unicast enum for the list of possible values. + * + * Generated from protobuf field optional string unicast = 249841711; + * @return string + */ + public function getUnicast() + { + return isset($this->unicast) ? $this->unicast : ''; + } + + public function hasUnicast() + { + return isset($this->unicast); + } + + public function clearUnicast() + { + unset($this->unicast); + } + + /** + * Specifies which type of unicast is supported. + * Check the Unicast enum for the list of possible values. + * + * Generated from protobuf field optional string unicast = 249841711; + * @param string $var + * @return $this + */ + public function setUnicast($var) + { + GPBUtil::checkString($var, True); + $this->unicast = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AddressPurposes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AddressPurposes.php new file mode 100644 index 000000000000..eb07488351d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AddressPurposes.php @@ -0,0 +1,105 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AddressPurposes + */ +class AddressPurposes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ADDRESS_PURPOSES = 0; + */ + const UNDEFINED_ADDRESS_PURPOSES = 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_ADDRESS_PURPOSES => 'UNDEFINED_ADDRESS_PURPOSES', + 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(AddressPurposes::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AddressPurposes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAliasIpRanges.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAliasIpRanges.php new file mode 100644 index 000000000000..db8258a54c77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAliasIpRanges.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowAliasIpRanges + */ +class AllowAliasIpRanges +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_ALIAS_IP_RANGES = 0; + */ + const UNDEFINED_ALLOW_ALIAS_IP_RANGES = 0; + /** + * Generated from protobuf enum ALIAS_IP_RANGES_ALLOWED = 464867048; + */ + const ALIAS_IP_RANGES_ALLOWED = 464867048; + /** + * Generated from protobuf enum ALIAS_IP_RANGES_BLOCKED = 281030444; + */ + const ALIAS_IP_RANGES_BLOCKED = 281030444; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_ALIAS_IP_RANGES => 'UNDEFINED_ALLOW_ALIAS_IP_RANGES', + self::ALIAS_IP_RANGES_ALLOWED => 'ALIAS_IP_RANGES_ALLOWED', + self::ALIAS_IP_RANGES_BLOCKED => 'ALIAS_IP_RANGES_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowAliasIpRanges::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowAliasIpRanges::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAutoModeSubnet.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAutoModeSubnet.php new file mode 100644 index 000000000000..6406aa32fb75 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowAutoModeSubnet.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowAutoModeSubnet + */ +class AllowAutoModeSubnet +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_AUTO_MODE_SUBNET = 0; + */ + const UNDEFINED_ALLOW_AUTO_MODE_SUBNET = 0; + /** + * Generated from protobuf enum AUTO_MODE_SUBNET_ALLOWED = 391042610; + */ + const AUTO_MODE_SUBNET_ALLOWED = 391042610; + /** + * Generated from protobuf enum AUTO_MODE_SUBNET_BLOCKED = 207206006; + */ + const AUTO_MODE_SUBNET_BLOCKED = 207206006; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_AUTO_MODE_SUBNET => 'UNDEFINED_ALLOW_AUTO_MODE_SUBNET', + self::AUTO_MODE_SUBNET_ALLOWED => 'AUTO_MODE_SUBNET_ALLOWED', + self::AUTO_MODE_SUBNET_BLOCKED => 'AUTO_MODE_SUBNET_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowAutoModeSubnet::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowAutoModeSubnet::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowClassDFirewalls.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowClassDFirewalls.php new file mode 100644 index 000000000000..f61e7e2db019 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowClassDFirewalls.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowClassDFirewalls + */ +class AllowClassDFirewalls +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_CLASS_D_FIREWALLS = 0; + */ + const UNDEFINED_ALLOW_CLASS_D_FIREWALLS = 0; + /** + * Generated from protobuf enum CLASS_D_FIREWALLS_ALLOWED = 348219386; + */ + const CLASS_D_FIREWALLS_ALLOWED = 348219386; + /** + * Generated from protobuf enum CLASS_D_FIREWALLS_BLOCKED = 164382782; + */ + const CLASS_D_FIREWALLS_BLOCKED = 164382782; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_CLASS_D_FIREWALLS => 'UNDEFINED_ALLOW_CLASS_D_FIREWALLS', + self::CLASS_D_FIREWALLS_ALLOWED => 'CLASS_D_FIREWALLS_ALLOWED', + self::CLASS_D_FIREWALLS_BLOCKED => 'CLASS_D_FIREWALLS_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowClassDFirewalls::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowClassDFirewalls::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudNat.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudNat.php new file mode 100644 index 000000000000..ed1077ca15a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudNat.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowCloudNat + */ +class AllowCloudNat +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_CLOUD_NAT = 0; + */ + const UNDEFINED_ALLOW_CLOUD_NAT = 0; + /** + * Generated from protobuf enum CLOUD_NAT_ALLOWED = 245931296; + */ + const CLOUD_NAT_ALLOWED = 245931296; + /** + * Generated from protobuf enum CLOUD_NAT_BLOCKED = 62094692; + */ + const CLOUD_NAT_BLOCKED = 62094692; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_CLOUD_NAT => 'UNDEFINED_ALLOW_CLOUD_NAT', + self::CLOUD_NAT_ALLOWED => 'CLOUD_NAT_ALLOWED', + self::CLOUD_NAT_BLOCKED => 'CLOUD_NAT_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowCloudNat::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowCloudNat::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudRouter.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudRouter.php new file mode 100644 index 000000000000..7809aa5f3ee7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowCloudRouter.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowCloudRouter + */ +class AllowCloudRouter +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_CLOUD_ROUTER = 0; + */ + const UNDEFINED_ALLOW_CLOUD_ROUTER = 0; + /** + * Generated from protobuf enum CLOUD_ROUTER_ALLOWED = 365388284; + */ + const CLOUD_ROUTER_ALLOWED = 365388284; + /** + * Generated from protobuf enum CLOUD_ROUTER_BLOCKED = 181551680; + */ + const CLOUD_ROUTER_BLOCKED = 181551680; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_CLOUD_ROUTER => 'UNDEFINED_ALLOW_CLOUD_ROUTER', + self::CLOUD_ROUTER_ALLOWED => 'CLOUD_ROUTER_ALLOWED', + self::CLOUD_ROUTER_BLOCKED => 'CLOUD_ROUTER_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowCloudRouter::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowCloudRouter::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowExternalIpAccess.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowExternalIpAccess.php new file mode 100644 index 000000000000..d1e95fd6971e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowExternalIpAccess.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowExternalIpAccess + */ +class AllowExternalIpAccess +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_EXTERNAL_IP_ACCESS = 0; + */ + const UNDEFINED_ALLOW_EXTERNAL_IP_ACCESS = 0; + /** + * Generated from protobuf enum EXTERNAL_IP_ACCESS_ALLOWED = 109530193; + */ + const EXTERNAL_IP_ACCESS_ALLOWED = 109530193; + /** + * Generated from protobuf enum EXTERNAL_IP_ACCESS_BLOCKED = 462564501; + */ + const EXTERNAL_IP_ACCESS_BLOCKED = 462564501; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_EXTERNAL_IP_ACCESS => 'UNDEFINED_ALLOW_EXTERNAL_IP_ACCESS', + self::EXTERNAL_IP_ACCESS_ALLOWED => 'EXTERNAL_IP_ACCESS_ALLOWED', + self::EXTERNAL_IP_ACCESS_BLOCKED => 'EXTERNAL_IP_ACCESS_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowExternalIpAccess::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowExternalIpAccess::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowInterconnect.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowInterconnect.php new file mode 100644 index 000000000000..fe8b0d7e6718 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowInterconnect.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowInterconnect + */ +class AllowInterconnect +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_INTERCONNECT = 0; + */ + const UNDEFINED_ALLOW_INTERCONNECT = 0; + /** + * Generated from protobuf enum INTERCONNECT_ALLOWED = 162845399; + */ + const INTERCONNECT_ALLOWED = 162845399; + /** + * Generated from protobuf enum INTERCONNECT_BLOCKED = 515879707; + */ + const INTERCONNECT_BLOCKED = 515879707; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_INTERCONNECT => 'UNDEFINED_ALLOW_INTERCONNECT', + self::INTERCONNECT_ALLOWED => 'INTERCONNECT_ALLOWED', + self::INTERCONNECT_BLOCKED => 'INTERCONNECT_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowInterconnect::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowInterconnect::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowLoadBalancing.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowLoadBalancing.php new file mode 100644 index 000000000000..85b2a3032803 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowLoadBalancing.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowLoadBalancing + */ +class AllowLoadBalancing +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_LOAD_BALANCING = 0; + */ + const UNDEFINED_ALLOW_LOAD_BALANCING = 0; + /** + * Generated from protobuf enum LOAD_BALANCING_ALLOWED = 28407977; + */ + const LOAD_BALANCING_ALLOWED = 28407977; + /** + * Generated from protobuf enum LOAD_BALANCING_BLOCKED = 381442285; + */ + const LOAD_BALANCING_BLOCKED = 381442285; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_LOAD_BALANCING => 'UNDEFINED_ALLOW_LOAD_BALANCING', + self::LOAD_BALANCING_ALLOWED => 'LOAD_BALANCING_ALLOWED', + self::LOAD_BALANCING_BLOCKED => 'LOAD_BALANCING_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowLoadBalancing::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowLoadBalancing::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowMultiNicInSameNetwork.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowMultiNicInSameNetwork.php new file mode 100644 index 000000000000..5c3b2c56729e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowMultiNicInSameNetwork.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowMultiNicInSameNetwork + */ +class AllowMultiNicInSameNetwork +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_MULTI_NIC_IN_SAME_NETWORK = 0; + */ + const UNDEFINED_ALLOW_MULTI_NIC_IN_SAME_NETWORK = 0; + /** + * Generated from protobuf enum MULTI_NIC_IN_SAME_NETWORK_ALLOWED = 457555419; + */ + const MULTI_NIC_IN_SAME_NETWORK_ALLOWED = 457555419; + /** + * Generated from protobuf enum MULTI_NIC_IN_SAME_NETWORK_BLOCKED = 273718815; + */ + const MULTI_NIC_IN_SAME_NETWORK_BLOCKED = 273718815; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_MULTI_NIC_IN_SAME_NETWORK => 'UNDEFINED_ALLOW_MULTI_NIC_IN_SAME_NETWORK', + self::MULTI_NIC_IN_SAME_NETWORK_ALLOWED => 'MULTI_NIC_IN_SAME_NETWORK_ALLOWED', + self::MULTI_NIC_IN_SAME_NETWORK_BLOCKED => 'MULTI_NIC_IN_SAME_NETWORK_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowMultiNicInSameNetwork::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowMultiNicInSameNetwork::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPacketMirroring.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPacketMirroring.php new file mode 100644 index 000000000000..ee5415e453da --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPacketMirroring.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowPacketMirroring + */ +class AllowPacketMirroring +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_PACKET_MIRRORING = 0; + */ + const UNDEFINED_ALLOW_PACKET_MIRRORING = 0; + /** + * Generated from protobuf enum PACKET_MIRRORING_ALLOWED = 92416245; + */ + const PACKET_MIRRORING_ALLOWED = 92416245; + /** + * Generated from protobuf enum PACKET_MIRRORING_BLOCKED = 445450553; + */ + const PACKET_MIRRORING_BLOCKED = 445450553; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_PACKET_MIRRORING => 'UNDEFINED_ALLOW_PACKET_MIRRORING', + self::PACKET_MIRRORING_ALLOWED => 'PACKET_MIRRORING_ALLOWED', + self::PACKET_MIRRORING_BLOCKED => 'PACKET_MIRRORING_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowPacketMirroring::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowPacketMirroring::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPrivateGoogleAccess.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPrivateGoogleAccess.php new file mode 100644 index 000000000000..da6afb0bc8f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPrivateGoogleAccess.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowPrivateGoogleAccess + */ +class AllowPrivateGoogleAccess +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_PRIVATE_GOOGLE_ACCESS = 0; + */ + const UNDEFINED_ALLOW_PRIVATE_GOOGLE_ACCESS = 0; + /** + * Generated from protobuf enum PRIVATE_GOOGLE_ACCESS_ALLOWED = 220787351; + */ + const PRIVATE_GOOGLE_ACCESS_ALLOWED = 220787351; + /** + * Generated from protobuf enum PRIVATE_GOOGLE_ACCESS_BLOCKED = 36950747; + */ + const PRIVATE_GOOGLE_ACCESS_BLOCKED = 36950747; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_PRIVATE_GOOGLE_ACCESS => 'UNDEFINED_ALLOW_PRIVATE_GOOGLE_ACCESS', + self::PRIVATE_GOOGLE_ACCESS_ALLOWED => 'PRIVATE_GOOGLE_ACCESS_ALLOWED', + self::PRIVATE_GOOGLE_ACCESS_BLOCKED => 'PRIVATE_GOOGLE_ACCESS_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowPrivateGoogleAccess::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowPrivateGoogleAccess::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPsc.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPsc.php new file mode 100644 index 000000000000..b5f821905c77 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowPsc.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowPsc + */ +class AllowPsc +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_PSC = 0; + */ + const UNDEFINED_ALLOW_PSC = 0; + /** + * Generated from protobuf enum PSC_ALLOWED = 171559657; + */ + const PSC_ALLOWED = 171559657; + /** + * Generated from protobuf enum PSC_BLOCKED = 524593965; + */ + const PSC_BLOCKED = 524593965; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_PSC => 'UNDEFINED_ALLOW_PSC', + self::PSC_ALLOWED => 'PSC_ALLOWED', + self::PSC_BLOCKED => 'PSC_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowPsc::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowPsc::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSameNetworkUnicast.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSameNetworkUnicast.php new file mode 100644 index 000000000000..17b335623cd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSameNetworkUnicast.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowSameNetworkUnicast + */ +class AllowSameNetworkUnicast +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_SAME_NETWORK_UNICAST = 0; + */ + const UNDEFINED_ALLOW_SAME_NETWORK_UNICAST = 0; + /** + * Generated from protobuf enum SAME_NETWORK_UNICAST_ALLOWED = 159732814; + */ + const SAME_NETWORK_UNICAST_ALLOWED = 159732814; + /** + * Generated from protobuf enum SAME_NETWORK_UNICAST_BLOCKED = 512767122; + */ + const SAME_NETWORK_UNICAST_BLOCKED = 512767122; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_SAME_NETWORK_UNICAST => 'UNDEFINED_ALLOW_SAME_NETWORK_UNICAST', + self::SAME_NETWORK_UNICAST_ALLOWED => 'SAME_NETWORK_UNICAST_ALLOWED', + self::SAME_NETWORK_UNICAST_BLOCKED => 'SAME_NETWORK_UNICAST_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowSameNetworkUnicast::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowSameNetworkUnicast::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowStaticRoutes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowStaticRoutes.php new file mode 100644 index 000000000000..2c272c0269c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowStaticRoutes.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowStaticRoutes + */ +class AllowStaticRoutes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_STATIC_ROUTES = 0; + */ + const UNDEFINED_ALLOW_STATIC_ROUTES = 0; + /** + * Generated from protobuf enum STATIC_ROUTES_ALLOWED = 409048964; + */ + const STATIC_ROUTES_ALLOWED = 409048964; + /** + * Generated from protobuf enum STATIC_ROUTES_BLOCKED = 225212360; + */ + const STATIC_ROUTES_BLOCKED = 225212360; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_STATIC_ROUTES => 'UNDEFINED_ALLOW_STATIC_ROUTES', + self::STATIC_ROUTES_ALLOWED => 'STATIC_ROUTES_ALLOWED', + self::STATIC_ROUTES_BLOCKED => 'STATIC_ROUTES_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowStaticRoutes::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowStaticRoutes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSubInterfaces.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSubInterfaces.php new file mode 100644 index 000000000000..9c935405c4a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowSubInterfaces.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowSubInterfaces + */ +class AllowSubInterfaces +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_SUB_INTERFACES = 0; + */ + const UNDEFINED_ALLOW_SUB_INTERFACES = 0; + /** + * Generated from protobuf enum SUBINTERFACES_ALLOWED = 158685891; + */ + const SUBINTERFACES_ALLOWED = 158685891; + /** + * Generated from protobuf enum SUBINTERFACES_BLOCKED = 511720199; + */ + const SUBINTERFACES_BLOCKED = 511720199; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_SUB_INTERFACES => 'UNDEFINED_ALLOW_SUB_INTERFACES', + self::SUBINTERFACES_ALLOWED => 'SUBINTERFACES_ALLOWED', + self::SUBINTERFACES_BLOCKED => 'SUBINTERFACES_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowSubInterfaces::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowSubInterfaces::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpcPeering.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpcPeering.php new file mode 100644 index 000000000000..7ac73732aa4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpcPeering.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowVpcPeering + */ +class AllowVpcPeering +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_VPC_PEERING = 0; + */ + const UNDEFINED_ALLOW_VPC_PEERING = 0; + /** + * Generated from protobuf enum VPC_PEERING_ALLOWED = 261465075; + */ + const VPC_PEERING_ALLOWED = 261465075; + /** + * Generated from protobuf enum VPC_PEERING_BLOCKED = 77628471; + */ + const VPC_PEERING_BLOCKED = 77628471; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_VPC_PEERING => 'UNDEFINED_ALLOW_VPC_PEERING', + self::VPC_PEERING_ALLOWED => 'VPC_PEERING_ALLOWED', + self::VPC_PEERING_BLOCKED => 'VPC_PEERING_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowVpcPeering::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowVpcPeering::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpn.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpn.php new file mode 100644 index 000000000000..68205c338d17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/AllowVpn.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.AllowVpn + */ +class AllowVpn +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_ALLOW_VPN = 0; + */ + const UNDEFINED_ALLOW_VPN = 0; + /** + * Generated from protobuf enum VPN_ALLOWED = 162163997; + */ + const VPN_ALLOWED = 162163997; + /** + * Generated from protobuf enum VPN_BLOCKED = 515198305; + */ + const VPN_BLOCKED = 515198305; + + private static $valueToName = [ + self::UNDEFINED_ALLOW_VPN => 'UNDEFINED_ALLOW_VPN', + self::VPN_ALLOWED => 'VPN_ALLOWED', + self::VPN_BLOCKED => 'VPN_BLOCKED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AllowVpn::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_AllowVpn::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/InterfaceTypes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/InterfaceTypes.php new file mode 100644 index 000000000000..046c5a1b0a80 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/InterfaceTypes.php @@ -0,0 +1,91 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.InterfaceTypes + */ +class InterfaceTypes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_INTERFACE_TYPES = 0; + */ + const UNDEFINED_INTERFACE_TYPES = 0; + /** + * GVNIC + * + * Generated from protobuf enum GVNIC = 68209305; + */ + const GVNIC = 68209305; + /** + * IDPF + * + * Generated from protobuf enum IDPF = 2242641; + */ + const IDPF = 2242641; + /** + * IRDMA + * + * Generated from protobuf enum IRDMA = 69927695; + */ + const IRDMA = 69927695; + /** + * MRDMA + * + * Generated from protobuf enum MRDMA = 73621779; + */ + const MRDMA = 73621779; + /** + * 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_INTERFACE_TYPES => 'UNDEFINED_INTERFACE_TYPES', + self::GVNIC => 'GVNIC', + self::IDPF => 'IDPF', + self::IRDMA => 'IRDMA', + self::MRDMA => 'MRDMA', + 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(InterfaceTypes::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_InterfaceTypes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetPurposes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetPurposes.php new file mode 100644 index 000000000000..e20a944b25a2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetPurposes.php @@ -0,0 +1,59 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.SubnetPurposes + */ +class SubnetPurposes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SUBNET_PURPOSES = 0; + */ + const UNDEFINED_SUBNET_PURPOSES = 0; + /** + * Generated from protobuf enum SUBNET_PURPOSE_CUSTOM_HARDWARE = 283160275; + */ + const SUBNET_PURPOSE_CUSTOM_HARDWARE = 283160275; + /** + * Generated from protobuf enum SUBNET_PURPOSE_PRIVATE = 404371008; + */ + const SUBNET_PURPOSE_PRIVATE = 404371008; + + private static $valueToName = [ + self::UNDEFINED_SUBNET_PURPOSES => 'UNDEFINED_SUBNET_PURPOSES', + self::SUBNET_PURPOSE_CUSTOM_HARDWARE => 'SUBNET_PURPOSE_CUSTOM_HARDWARE', + self::SUBNET_PURPOSE_PRIVATE => 'SUBNET_PURPOSE_PRIVATE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SubnetPurposes::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_SubnetPurposes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetStackTypes.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetStackTypes.php new file mode 100644 index 000000000000..af52fe611888 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/SubnetStackTypes.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.SubnetStackTypes + */ +class SubnetStackTypes +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_SUBNET_STACK_TYPES = 0; + */ + const UNDEFINED_SUBNET_STACK_TYPES = 0; + /** + * Generated from protobuf enum SUBNET_STACK_TYPE_IPV4_IPV6 = 41454485; + */ + const SUBNET_STACK_TYPE_IPV4_IPV6 = 41454485; + /** + * Generated from protobuf enum SUBNET_STACK_TYPE_IPV4_ONLY = 41631034; + */ + const SUBNET_STACK_TYPE_IPV4_ONLY = 41631034; + /** + * Generated from protobuf enum SUBNET_STACK_TYPE_IPV6_ONLY = 98889336; + */ + const SUBNET_STACK_TYPE_IPV6_ONLY = 98889336; + + private static $valueToName = [ + self::UNDEFINED_SUBNET_STACK_TYPES => 'UNDEFINED_SUBNET_STACK_TYPES', + self::SUBNET_STACK_TYPE_IPV4_IPV6 => 'SUBNET_STACK_TYPE_IPV4_IPV6', + self::SUBNET_STACK_TYPE_IPV4_ONLY => 'SUBNET_STACK_TYPE_IPV4_ONLY', + self::SUBNET_STACK_TYPE_IPV6_ONLY => 'SUBNET_STACK_TYPE_IPV6_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(SubnetStackTypes::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_SubnetStackTypes::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/Unicast.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/Unicast.php new file mode 100644 index 000000000000..d4494c750f91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfileNetworkFeatures/Unicast.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkProfileNetworkFeatures.Unicast + */ +class Unicast +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_UNICAST = 0; + */ + const UNDEFINED_UNICAST = 0; + /** + * Generated from protobuf enum UNICAST_SDN = 379954157; + */ + const UNICAST_SDN = 379954157; + /** + * Generated from protobuf enum UNICAST_ULL = 379956325; + */ + const UNICAST_ULL = 379956325; + + private static $valueToName = [ + self::UNDEFINED_UNICAST => 'UNDEFINED_UNICAST', + self::UNICAST_SDN => 'UNICAST_SDN', + self::UNICAST_ULL => 'UNICAST_ULL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Unicast::class, \Google\Cloud\Compute\V1\NetworkProfileNetworkFeatures_Unicast::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfilesListResponse.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfilesListResponse.php new file mode 100644 index 000000000000..aef1b6bb19ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkProfilesListResponse.php @@ -0,0 +1,358 @@ +google.cloud.compute.v1.NetworkProfilesListResponse + */ +class NetworkProfilesListResponse 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 NetworkProfile resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkProfile items = 100526016; + */ + private $items; + /** + * [Output Only] Type of resource. Always compute#networkProfileList for network profiles. + * + * 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\NetworkProfile>|\Google\Protobuf\Internal\RepeatedField $items + * A list of NetworkProfile resources. + * @type string $kind + * [Output Only] Type of resource. Always compute#networkProfileList for network profiles. + * @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 NetworkProfile resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkProfile items = 100526016; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getItems() + { + return $this->items; + } + + /** + * A list of NetworkProfile resources. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.NetworkProfile items = 100526016; + * @param array<\Google\Cloud\Compute\V1\NetworkProfile>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setItems($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\NetworkProfile::class); + $this->items = $arr; + + return $this; + } + + /** + * [Output Only] Type of resource. Always compute#networkProfileList for network profiles. + * + * 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#networkProfileList for network profiles. + * + * 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/NetworkRoutingConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig.php new file mode 100644 index 000000000000..c836581d16b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig.php @@ -0,0 +1,221 @@ +google.cloud.compute.v1.NetworkRoutingConfig + */ +class NetworkRoutingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Enable comparison of Multi-Exit Discriminators (MED) across routes with different neighbor ASNs when using the STANDARD BGP best path selection algorithm. + * + * Generated from protobuf field optional bool bgp_always_compare_med = 213102902; + */ + protected $bgp_always_compare_med = null; + /** + * The BGP best path selection algorithm to be employed within this network for dynamic routes learned by Cloud Routers. Can be LEGACY (default) or STANDARD. + * Check the BgpBestPathSelectionMode enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_best_path_selection_mode = 317816297; + */ + protected $bgp_best_path_selection_mode = null; + /** + * Allows to define a preferred approach for handling inter-region cost in the selection process when using the STANDARD BGP best path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED. + * Check the BgpInterRegionCost enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_inter_region_cost = 462142689; + */ + protected $bgp_inter_region_cost = null; + /** + * 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 bool $bgp_always_compare_med + * Enable comparison of Multi-Exit Discriminators (MED) across routes with different neighbor ASNs when using the STANDARD BGP best path selection algorithm. + * @type string $bgp_best_path_selection_mode + * The BGP best path selection algorithm to be employed within this network for dynamic routes learned by Cloud Routers. Can be LEGACY (default) or STANDARD. + * Check the BgpBestPathSelectionMode enum for the list of possible values. + * @type string $bgp_inter_region_cost + * Allows to define a preferred approach for handling inter-region cost in the selection process when using the STANDARD BGP best path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED. + * Check the BgpInterRegionCost enum for the list of possible values. + * @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); + } + + /** + * Enable comparison of Multi-Exit Discriminators (MED) across routes with different neighbor ASNs when using the STANDARD BGP best path selection algorithm. + * + * Generated from protobuf field optional bool bgp_always_compare_med = 213102902; + * @return bool + */ + public function getBgpAlwaysCompareMed() + { + return isset($this->bgp_always_compare_med) ? $this->bgp_always_compare_med : false; + } + + public function hasBgpAlwaysCompareMed() + { + return isset($this->bgp_always_compare_med); + } + + public function clearBgpAlwaysCompareMed() + { + unset($this->bgp_always_compare_med); + } + + /** + * Enable comparison of Multi-Exit Discriminators (MED) across routes with different neighbor ASNs when using the STANDARD BGP best path selection algorithm. + * + * Generated from protobuf field optional bool bgp_always_compare_med = 213102902; + * @param bool $var + * @return $this + */ + public function setBgpAlwaysCompareMed($var) + { + GPBUtil::checkBool($var); + $this->bgp_always_compare_med = $var; + + return $this; + } + + /** + * The BGP best path selection algorithm to be employed within this network for dynamic routes learned by Cloud Routers. Can be LEGACY (default) or STANDARD. + * Check the BgpBestPathSelectionMode enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_best_path_selection_mode = 317816297; + * @return string + */ + public function getBgpBestPathSelectionMode() + { + return isset($this->bgp_best_path_selection_mode) ? $this->bgp_best_path_selection_mode : ''; + } + + public function hasBgpBestPathSelectionMode() + { + return isset($this->bgp_best_path_selection_mode); + } + + public function clearBgpBestPathSelectionMode() + { + unset($this->bgp_best_path_selection_mode); + } + + /** + * The BGP best path selection algorithm to be employed within this network for dynamic routes learned by Cloud Routers. Can be LEGACY (default) or STANDARD. + * Check the BgpBestPathSelectionMode enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_best_path_selection_mode = 317816297; + * @param string $var + * @return $this + */ + public function setBgpBestPathSelectionMode($var) + { + GPBUtil::checkString($var, True); + $this->bgp_best_path_selection_mode = $var; + + return $this; + } + + /** + * Allows to define a preferred approach for handling inter-region cost in the selection process when using the STANDARD BGP best path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED. + * Check the BgpInterRegionCost enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_inter_region_cost = 462142689; + * @return string + */ + public function getBgpInterRegionCost() + { + return isset($this->bgp_inter_region_cost) ? $this->bgp_inter_region_cost : ''; + } + + public function hasBgpInterRegionCost() + { + return isset($this->bgp_inter_region_cost); + } + + public function clearBgpInterRegionCost() + { + unset($this->bgp_inter_region_cost); + } + + /** + * Allows to define a preferred approach for handling inter-region cost in the selection process when using the STANDARD BGP best path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED. + * Check the BgpInterRegionCost enum for the list of possible values. + * + * Generated from protobuf field optional string bgp_inter_region_cost = 462142689; + * @param string $var + * @return $this + */ + public function setBgpInterRegionCost($var) + { + GPBUtil::checkString($var, True); + $this->bgp_inter_region_cost = $var; + + return $this; + } + + /** + * 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/BgpBestPathSelectionMode.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/BgpBestPathSelectionMode.php new file mode 100644 index 000000000000..871aec686149 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/BgpBestPathSelectionMode.php @@ -0,0 +1,60 @@ +google.cloud.compute.v1.NetworkRoutingConfig.BgpBestPathSelectionMode + */ +class BgpBestPathSelectionMode +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BGP_BEST_PATH_SELECTION_MODE = 0; + */ + const UNDEFINED_BGP_BEST_PATH_SELECTION_MODE = 0; + /** + * Generated from protobuf enum LEGACY = 94234569; + */ + const LEGACY = 94234569; + /** + * Generated from protobuf enum STANDARD = 484642493; + */ + const STANDARD = 484642493; + + private static $valueToName = [ + self::UNDEFINED_BGP_BEST_PATH_SELECTION_MODE => 'UNDEFINED_BGP_BEST_PATH_SELECTION_MODE', + self::LEGACY => 'LEGACY', + 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(BgpBestPathSelectionMode::class, \Google\Cloud\Compute\V1\NetworkRoutingConfig_BgpBestPathSelectionMode::class); + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/BgpInterRegionCost.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/BgpInterRegionCost.php new file mode 100644 index 000000000000..dc9f4115be04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworkRoutingConfig/BgpInterRegionCost.php @@ -0,0 +1,64 @@ +google.cloud.compute.v1.NetworkRoutingConfig.BgpInterRegionCost + */ +class BgpInterRegionCost +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_BGP_INTER_REGION_COST = 0; + */ + const UNDEFINED_BGP_INTER_REGION_COST = 0; + /** + * Generated from protobuf enum ADD_COST_TO_MED = 490583004; + */ + const ADD_COST_TO_MED = 490583004; + /** + * Generated from protobuf enum DEFAULT = 115302945; + */ + const PBDEFAULT = 115302945; + + private static $valueToName = [ + self::UNDEFINED_BGP_INTER_REGION_COST => 'UNDEFINED_BGP_INTER_REGION_COST', + self::ADD_COST_TO_MED => 'ADD_COST_TO_MED', + 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(BgpInterRegionCost::class, \Google\Cloud\Compute\V1\NetworkRoutingConfig_BgpInterRegionCost::class); + 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..e61eeb5d0268 --- /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 +{ + /** + * [Output Only] Effective firewalls from firewall policy. It returns Global Network Firewall Policies and Hierarchical Firewall Policies. Use regionNetworkFirewallPolicies.getEffectiveFirewalls to get Regional Network Firewall Policies as well. + * + * 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 + * [Output Only] Effective firewalls from firewall policy. It returns Global Network Firewall Policies and Hierarchical Firewall Policies. Use regionNetworkFirewallPolicies.getEffectiveFirewalls to get Regional Network Firewall Policies as well. + * @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); + } + + /** + * [Output Only] Effective firewalls from firewall policy. It returns Global Network Firewall Policies and Hierarchical Firewall Policies. Use regionNetworkFirewallPolicies.getEffectiveFirewalls to get Regional Network Firewall Policies as well. + * + * 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; + } + + /** + * [Output Only] Effective firewalls from firewall policy. It returns Global Network Firewall Policies and Hierarchical Firewall Policies. Use regionNetworkFirewallPolicies.getEffectiveFirewalls to get Regional Network Firewall Policies as well. + * + * 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..171ed6d199bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.php @@ -0,0 +1,290 @@ +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; + /** + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * + * Generated from protobuf field optional int32 priority = 445151652; + */ + protected $priority = null; + /** + * [Output Only] 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 int $priority + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * @type array<\Google\Cloud\Compute\V1\FirewallPolicyRule>|\Google\Protobuf\Internal\RepeatedField $rules + * [Output Only] 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; + } + + /** + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * + * 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); + } + + /** + * [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + * + * 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] 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; + } + + /** + * [Output Only] 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..37e33c93d305 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy/Type.php @@ -0,0 +1,70 @@ +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 SYSTEM = 313484847; + */ + const SYSTEM = 313484847; + /** + * Generated from protobuf enum UNSPECIFIED = 526786327; + */ + const UNSPECIFIED = 526786327; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::HIERARCHY => 'HIERARCHY', + self::NETWORK => 'NETWORK', + self::SYSTEM => 'SYSTEM', + 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..aa30d650ec02 --- /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 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 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 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 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..0b34421db5ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathMatcher.php @@ -0,0 +1,409 @@ +google.cloud.compute.v1.PathMatcher + */ +class PathMatcher extends \Google\Protobuf\Internal\Message +{ + /** + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy default_custom_error_response_policy = 81266089; + */ + protected $default_custom_error_response_policy = null; + /** + * 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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; + /** + * 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\CustomErrorResponsePolicy $default_custom_error_response_policy + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * @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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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 \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); + } + + /** + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy default_custom_error_response_policy = 81266089; + * @return \Google\Cloud\Compute\V1\CustomErrorResponsePolicy|null + */ + public function getDefaultCustomErrorResponsePolicy() + { + return $this->default_custom_error_response_policy; + } + + public function hasDefaultCustomErrorResponsePolicy() + { + return isset($this->default_custom_error_response_policy); + } + + public function clearDefaultCustomErrorResponsePolicy() + { + unset($this->default_custom_error_response_policy); + } + + /** + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the PathMatcher level and applies only when no policy has been defined for the error code at lower levels like RouteRule and PathRule within this PathMatcher. If an error code does not have a policy defined in defaultCustomErrorResponsePolicy, then a policy defined for the error code in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy is configured with policies for 5xx and 4xx errors - A RouteRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in RouteRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with pathMatcher.defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy default_custom_error_response_policy = 81266089; + * @param \Google\Cloud\Compute\V1\CustomErrorResponsePolicy $var + * @return $this + */ + public function setDefaultCustomErrorResponsePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomErrorResponsePolicy::class); + $this->default_custom_error_response_policy = $var; + + return $this; + } + + /** + * 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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 pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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; + } + + /** + * 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..c5015ae92f86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/PathRule.php @@ -0,0 +1,243 @@ +google.cloud.compute.v1.PathRule + */ +class PathRule extends \Google\Protobuf\Internal\Message +{ + /** + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619; + */ + protected $custom_error_response_policy = null; + /** + * 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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 \Google\Cloud\Compute\V1\CustomErrorResponsePolicy $custom_error_response_policy + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * @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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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); + } + + /** + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619; + * @return \Google\Cloud\Compute\V1\CustomErrorResponsePolicy|null + */ + public function getCustomErrorResponsePolicy() + { + return $this->custom_error_response_policy; + } + + public function hasCustomErrorResponsePolicy() + { + return isset($this->custom_error_response_policy); + } + + public function clearCustomErrorResponsePolicy() + { + unset($this->custom_error_response_policy); + } + + /** + * customErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. If a policy for an error code is not configured for the PathRule, a policy for the error code configured in pathMatcher.defaultCustomErrorResponsePolicy is applied. If one is not specified in pathMatcher.defaultCustomErrorResponsePolicy, the policy configured in UrlMap.defaultCustomErrorResponsePolicy takes effect. For example, consider a UrlMap with the following configuration: - UrlMap.defaultCustomErrorResponsePolicy are configured with policies for 5xx and 4xx errors - A PathRule for /coming_soon/ is configured for the error code 404. If the request is for www.myotherdomain.com and a 404 is encountered, the policy under UrlMap.defaultCustomErrorResponsePolicy takes effect. If a 404 response is encountered for the request www.example.com/current_events/, the pathMatcher's policy takes effect. If however, the request for www.example.com/coming_soon/ encounters a 404, the policy in PathRule.customErrorResponsePolicy takes effect. If any of the requests in this example encounter a 500 error code, the policy at UrlMap.defaultCustomErrorResponsePolicy takes effect. customErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy custom_error_response_policy = 202816619; + * @param \Google\Cloud\Compute\V1\CustomErrorResponsePolicy $var + * @return $this + */ + public function setCustomErrorResponsePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomErrorResponsePolicy::class); + $this->custom_error_response_policy = $var; + + return $this; + } + + /** + * 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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. Only one of urlRedirect, service or routeAction.weightedBackendService can 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..b1ae100f728d --- /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 configuration 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 configuration 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 configuration 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 configuration 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..d43151e82bad --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Policy.php @@ -0,0 +1,226 @@ +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; + /** + * 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 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; + } + + /** + * 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..15adc640d920 --- /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; + /** + * An optional list of 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; + /** + * An optional 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 + * An optional list of 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 + * An optional 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; + } + + /** + * An optional list of 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; + } + + /** + * An optional list of 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; + } + + /** + * An optional 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); + } + + /** + * An optional 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..3ad154b08d09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Quota/Metric.php @@ -0,0 +1,874 @@ +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 VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES = 128400161; + */ + const VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES = 128400161; + /** + * 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::VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES => 'VARIABLE_IPV6_PUBLIC_DELEGATED_PREFIXES', + 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..a7c96c7d4f92 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/QuotaStatusWarning/Code.php @@ -0,0 +1,253 @@ +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; + /** + * Quota information is not available to client requests (e.g: regions.list). + * + * Generated from protobuf enum QUOTA_INFO_UNAVAILABLE = 304294182; + */ + const QUOTA_INFO_UNAVAILABLE = 304294182; + /** + * 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::QUOTA_INFO_UNAVAILABLE => 'QUOTA_INFO_UNAVAILABLE', + 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/RegionInstanceGroupManagersResumeInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersResumeInstancesRequest.php new file mode 100644 index 000000000000..c3cbc2f311f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersResumeInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersResumeInstancesRequest + */ +class RegionInstanceGroupManagersResumeInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to resume. 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 resume. 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 resume. 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 resume. 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/RegionInstanceGroupManagersStartInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersStartInstancesRequest.php new file mode 100644 index 000000000000..a4198df15373 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersStartInstancesRequest.php @@ -0,0 +1,66 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersStartInstancesRequest + */ +class RegionInstanceGroupManagersStartInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The URLs of one or more instances to start. 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 start. 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 start. 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 start. 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/RegionInstanceGroupManagersStopInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersStopInstancesRequest.php new file mode 100644 index 000000000000..080161f5260e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersStopInstancesRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersStopInstancesRequest + */ +class RegionInstanceGroupManagersStopInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_stop = 134762710; + */ + protected $force_stop = null; + /** + * The URLs of one or more instances to stop. 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 bool $force_stop + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to stop. 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); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_stop = 134762710; + * @return bool + */ + public function getForceStop() + { + return isset($this->force_stop) ? $this->force_stop : false; + } + + public function hasForceStop() + { + return isset($this->force_stop); + } + + public function clearForceStop() + { + unset($this->force_stop); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_stop = 134762710; + * @param bool $var + * @return $this + */ + public function setForceStop($var) + { + GPBUtil::checkBool($var); + $this->force_stop = $var; + + return $this; + } + + /** + * The URLs of one or more instances to stop. 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 stop. 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/RegionInstanceGroupManagersSuspendInstancesRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSuspendInstancesRequest.php new file mode 100644 index 000000000000..0d18c2261d06 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/RegionInstanceGroupManagersSuspendInstancesRequest.php @@ -0,0 +1,110 @@ +google.cloud.compute.v1.RegionInstanceGroupManagersSuspendInstancesRequest + */ +class RegionInstanceGroupManagersSuspendInstancesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_suspend = 27637480; + */ + protected $force_suspend = null; + /** + * The URLs of one or more instances to suspend. 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 bool $force_suspend + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * @type array|\Google\Protobuf\Internal\RepeatedField $instances + * The URLs of one or more instances to suspend. 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); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_suspend = 27637480; + * @return bool + */ + public function getForceSuspend() + { + return isset($this->force_suspend) ? $this->force_suspend : false; + } + + public function hasForceSuspend() + { + return isset($this->force_suspend); + } + + public function clearForceSuspend() + { + unset($this->force_suspend); + } + + /** + * If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them. + * + * Generated from protobuf field optional bool force_suspend = 27637480; + * @param bool $var + * @return $this + */ + public function setForceSuspend($var) + { + GPBUtil::checkBool($var); + $this->force_suspend = $var; + + return $this; + } + + /** + * The URLs of one or more instances to suspend. 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 suspend. 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/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..4da35401010d --- /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 +{ + /** + * [Output only] Effective firewalls from firewall policy. It applies to Regional Network Firewall Policies in the specified region, Global Network Firewall Policies and Hierachial Firewall Policies which are associated with the network. + * + * 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 + * [Output only] Effective firewalls from firewall policy. It applies to Regional Network Firewall Policies in the specified region, Global Network Firewall Policies and Hierachial Firewall Policies which are associated with the network. + * @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); + } + + /** + * [Output only] Effective firewalls from firewall policy. It applies to Regional Network Firewall Policies in the specified region, Global Network Firewall Policies and Hierachial Firewall Policies which are associated with the network. + * + * 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; + } + + /** + * [Output only] Effective firewalls from firewall policy. It applies to Regional Network Firewall Policies in the specified region, Global Network Firewall Policies and Hierachial Firewall Policies which are associated with the network. + * + * 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..e57f05e9ee34 --- /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; + /** + * [Output only] 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 + * [Output only] 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; + } + + /** + * [Output only] 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; + } + + /** + * [Output only] 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..80cc3d7ae74d --- /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. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. + * 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. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. + * 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. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. + * 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. - CREATING: Reservation resources are being allocated. - READY: Reservation resources have been allocated, and the reservation is ready for use. - DELETING: Reservation deletion is in progress. - UPDATING: Reservation update is in progress. + * 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..9973daecfb3f --- /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; + /** + * Reservation resources are being allocated. + * + * Generated from protobuf enum CREATING = 455564985; + */ + const CREATING = 455564985; + /** + * Reservation deletion is in progress. + * + * Generated from protobuf enum DELETING = 528602024; + */ + const DELETING = 528602024; + /** + * Generated from protobuf enum INVALID = 530283991; + */ + const INVALID = 530283991; + /** + * Reservation resources have been allocated, and the reservation is ready for use. + * + * Generated from protobuf enum READY = 77848963; + */ + const READY = 77848963; + /** + * Reservation update is in progress. + * + * 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..a9a0bfda5bb1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatus.php @@ -0,0 +1,151 @@ +google.cloud.compute.v1.ResourceStatus + */ +class ResourceStatus extends \Google\Protobuf\Internal\Message +{ + /** + * [Output Only] The precise location of your instance within the zone's data center, including the block, sub-block, and host. The field is formatted as follows: blockId/subBlockId/hostId. + * + * Generated from protobuf field optional string physical_host = 464370704; + */ + protected $physical_host = null; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourceStatusScheduling scheduling = 386688404; + */ + protected $scheduling = 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] The precise location of your instance within the zone's data center, including the block, sub-block, and host. The field is formatted as follows: blockId/subBlockId/hostId. + * @type \Google\Cloud\Compute\V1\ResourceStatusScheduling $scheduling + * @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] The precise location of your instance within the zone's data center, including the block, sub-block, and host. The field is formatted as follows: blockId/subBlockId/hostId. + * + * 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] The precise location of your instance within the zone's data center, including the block, sub-block, and host. The field is formatted as follows: blockId/subBlockId/hostId. + * + * 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.ResourceStatusScheduling scheduling = 386688404; + * @return \Google\Cloud\Compute\V1\ResourceStatusScheduling|null + */ + public function getScheduling() + { + return $this->scheduling; + } + + public function hasScheduling() + { + return isset($this->scheduling); + } + + public function clearScheduling() + { + unset($this->scheduling); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.ResourceStatusScheduling scheduling = 386688404; + * @param \Google\Cloud\Compute\V1\ResourceStatusScheduling $var + * @return $this + */ + public function setScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ResourceStatusScheduling::class); + $this->scheduling = $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/ResourceStatusScheduling.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatusScheduling.php new file mode 100644 index 000000000000..58e85289a9ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResourceStatusScheduling.php @@ -0,0 +1,76 @@ +google.cloud.compute.v1.ResourceStatusScheduling + */ +class ResourceStatusScheduling extends \Google\Protobuf\Internal\Message +{ + /** + * Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * + * Generated from protobuf field optional int32 availability_domain = 252514344; + */ + protected $availability_domain = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $availability_domain + * Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * + * Generated from protobuf field optional int32 availability_domain = 252514344; + * @return int + */ + public function getAvailabilityDomain() + { + return isset($this->availability_domain) ? $this->availability_domain : 0; + } + + public function hasAvailabilityDomain() + { + return isset($this->availability_domain); + } + + public function clearAvailabilityDomain() + { + unset($this->availability_domain); + } + + /** + * Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * + * Generated from protobuf field optional int32 availability_domain = 252514344; + * @param int $var + * @return $this + */ + public function setAvailabilityDomain($var) + { + GPBUtil::checkInt32($var); + $this->availability_domain = $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/ResumeInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..2e8920315311 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.ResumeInstancesInstanceGroupManagerRequest + */ +class ResumeInstancesInstanceGroupManagerRequest 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.InstanceGroupManagersResumeInstancesRequest instance_group_managers_resume_instances_request_resource = 129015618 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_resume_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\InstanceGroupManagersResumeInstancesRequest $instanceGroupManagersResumeInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ResumeInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersResumeInstancesRequest $instanceGroupManagersResumeInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersResumeInstancesRequestResource($instanceGroupManagersResumeInstancesRequestResource); + } + + /** + * 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\InstanceGroupManagersResumeInstancesRequest $instance_group_managers_resume_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.InstanceGroupManagersResumeInstancesRequest instance_group_managers_resume_instances_request_resource = 129015618 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersResumeInstancesRequest|null + */ + public function getInstanceGroupManagersResumeInstancesRequestResource() + { + return $this->instance_group_managers_resume_instances_request_resource; + } + + public function hasInstanceGroupManagersResumeInstancesRequestResource() + { + return isset($this->instance_group_managers_resume_instances_request_resource); + } + + public function clearInstanceGroupManagersResumeInstancesRequestResource() + { + unset($this->instance_group_managers_resume_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersResumeInstancesRequest instance_group_managers_resume_instances_request_resource = 129015618 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersResumeInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersResumeInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersResumeInstancesRequest::class); + $this->instance_group_managers_resume_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/ResumeInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..948885317be3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ResumeInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.ResumeInstancesRegionInstanceGroupManagerRequest + */ +class ResumeInstancesRegionInstanceGroupManagerRequest 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.RegionInstanceGroupManagersResumeInstancesRequest region_instance_group_managers_resume_instances_request_resource = 463471031 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_resume_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\RegionInstanceGroupManagersResumeInstancesRequest $regionInstanceGroupManagersResumeInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\ResumeInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersResumeInstancesRequest $regionInstanceGroupManagersResumeInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersResumeInstancesRequestResource($regionInstanceGroupManagersResumeInstancesRequestResource); + } + + /** + * 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\RegionInstanceGroupManagersResumeInstancesRequest $region_instance_group_managers_resume_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.RegionInstanceGroupManagersResumeInstancesRequest region_instance_group_managers_resume_instances_request_resource = 463471031 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersResumeInstancesRequest|null + */ + public function getRegionInstanceGroupManagersResumeInstancesRequestResource() + { + return $this->region_instance_group_managers_resume_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersResumeInstancesRequestResource() + { + return isset($this->region_instance_group_managers_resume_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersResumeInstancesRequestResource() + { + unset($this->region_instance_group_managers_resume_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersResumeInstancesRequest region_instance_group_managers_resume_instances_request_resource = 463471031 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersResumeInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersResumeInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersResumeInstancesRequest::class); + $this->region_instance_group_managers_resume_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/Route.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route.php new file mode 100644 index 000000000000..f16bbe795515 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route.php @@ -0,0 +1,1115 @@ +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: - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule If an IP address is provided, must specify an IPv4 address in dot-decimal notation or an IPv6 address in RFC 4291 format. For example, the following are all valid IP addresses: - 10.128.0.56 - 2001:db8::2d9:51:0:0 - 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_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; + /** + * [Output only] Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions. + * + * Generated from protobuf field optional uint32 next_hop_inter_region_cost = 24442003; + */ + protected $next_hop_inter_region_cost = 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; + /** + * [Output Only] Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network. + * + * Generated from protobuf field optional uint32 next_hop_med = 198683530; + */ + protected $next_hop_med = 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] Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + * Check the NextHopOrigin enum for the list of possible values. + * + * Generated from protobuf field optional string next_hop_origin = 48752808; + */ + protected $next_hop_origin = 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: - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule If an IP address is provided, must specify an IPv4 address in dot-decimal notation or an IPv6 address in RFC 4291 format. For example, the following are all valid IP addresses: - 10.128.0.56 - 2001:db8::2d9:51:0:0 - 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_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 int $next_hop_inter_region_cost + * [Output only] Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions. + * @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 int $next_hop_med + * [Output Only] Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network. + * @type string $next_hop_network + * The URL of the local network if it should handle matching packets. + * @type string $next_hop_origin + * [Output Only] Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + * Check the NextHopOrigin enum for the list of possible values. + * @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: - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule If an IP address is provided, must specify an IPv4 address in dot-decimal notation or an IPv6 address in RFC 4291 format. For example, the following are all valid IP addresses: - 10.128.0.56 - 2001:db8::2d9:51:0:0 - 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_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: - https://www.googleapis.com/compute/v1/projects/project/regions/region /forwardingRules/forwardingRule - regions/region/forwardingRules/forwardingRule If an IP address is provided, must specify an IPv4 address in dot-decimal notation or an IPv6 address in RFC 4291 format. For example, the following are all valid IP addresses: - 10.128.0.56 - 2001:db8::2d9:51:0:0 - 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_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; + } + + /** + * [Output only] Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions. + * + * Generated from protobuf field optional uint32 next_hop_inter_region_cost = 24442003; + * @return int + */ + public function getNextHopInterRegionCost() + { + return isset($this->next_hop_inter_region_cost) ? $this->next_hop_inter_region_cost : 0; + } + + public function hasNextHopInterRegionCost() + { + return isset($this->next_hop_inter_region_cost); + } + + public function clearNextHopInterRegionCost() + { + unset($this->next_hop_inter_region_cost); + } + + /** + * [Output only] Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions. + * + * Generated from protobuf field optional uint32 next_hop_inter_region_cost = 24442003; + * @param int $var + * @return $this + */ + public function setNextHopInterRegionCost($var) + { + GPBUtil::checkUint32($var); + $this->next_hop_inter_region_cost = $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; + } + + /** + * [Output Only] Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network. + * + * Generated from protobuf field optional uint32 next_hop_med = 198683530; + * @return int + */ + public function getNextHopMed() + { + return isset($this->next_hop_med) ? $this->next_hop_med : 0; + } + + public function hasNextHopMed() + { + return isset($this->next_hop_med); + } + + public function clearNextHopMed() + { + unset($this->next_hop_med); + } + + /** + * [Output Only] Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network. + * + * Generated from protobuf field optional uint32 next_hop_med = 198683530; + * @param int $var + * @return $this + */ + public function setNextHopMed($var) + { + GPBUtil::checkUint32($var); + $this->next_hop_med = $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] Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + * Check the NextHopOrigin enum for the list of possible values. + * + * Generated from protobuf field optional string next_hop_origin = 48752808; + * @return string + */ + public function getNextHopOrigin() + { + return isset($this->next_hop_origin) ? $this->next_hop_origin : ''; + } + + public function hasNextHopOrigin() + { + return isset($this->next_hop_origin); + } + + public function clearNextHopOrigin() + { + unset($this->next_hop_origin); + } + + /** + * [Output Only] Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + * Check the NextHopOrigin enum for the list of possible values. + * + * Generated from protobuf field optional string next_hop_origin = 48752808; + * @param string $var + * @return $this + */ + public function setNextHopOrigin($var) + { + GPBUtil::checkString($var, True); + $this->next_hop_origin = $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/NextHopOrigin.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/NextHopOrigin.php new file mode 100644 index 000000000000..761f1444a14a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Route/NextHopOrigin.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.Route.NextHopOrigin + */ +class NextHopOrigin +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_NEXT_HOP_ORIGIN = 0; + */ + const UNDEFINED_NEXT_HOP_ORIGIN = 0; + /** + * Generated from protobuf enum EGP = 68590; + */ + const EGP = 68590; + /** + * Generated from protobuf enum IGP = 72434; + */ + const IGP = 72434; + /** + * Generated from protobuf enum INCOMPLETE = 11941214; + */ + const INCOMPLETE = 11941214; + + private static $valueToName = [ + self::UNDEFINED_NEXT_HOP_ORIGIN => 'UNDEFINED_NEXT_HOP_ORIGIN', + self::EGP => 'EGP', + self::IGP => 'IGP', + self::INCOMPLETE => 'INCOMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(NextHopOrigin::class, \Google\Cloud\Compute\V1\Route_NextHopOrigin::class); + 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..28a3770f927c --- /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..065345519255 --- /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 +{ + /** + * A list of the best dynamic routes for this Cloud Router's Virtual Private Cloud (VPC) network in the same region as this Cloud Router. Lists all of the best routes per prefix that are programmed into this region's VPC data plane. When global dynamic routing mode is turned on in the VPC network, this list can include cross-region dynamic routes from Cloud Routers in other regions. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.Route best_routes = 395826693; + */ + private $best_routes; + /** + * A list of the best BGP routes learned by this Cloud Router. It is possible that routes listed might not be programmed into the data plane, if the Google Cloud control plane finds a more optimal route for a prefix than a route learned by this Cloud 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 + * A list of the best dynamic routes for this Cloud Router's Virtual Private Cloud (VPC) network in the same region as this Cloud Router. Lists all of the best routes per prefix that are programmed into this region's VPC data plane. When global dynamic routing mode is turned on in the VPC network, this list can include cross-region dynamic routes from Cloud Routers in other regions. + * @type array<\Google\Cloud\Compute\V1\Route>|\Google\Protobuf\Internal\RepeatedField $best_routes_for_router + * A list of the best BGP routes learned by this Cloud Router. It is possible that routes listed might not be programmed into the data plane, if the Google Cloud control plane finds a more optimal route for a prefix than a route learned by this Cloud 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); + } + + /** + * A list of the best dynamic routes for this Cloud Router's Virtual Private Cloud (VPC) network in the same region as this Cloud Router. Lists all of the best routes per prefix that are programmed into this region's VPC data plane. When global dynamic routing mode is turned on in the VPC network, this list can include cross-region dynamic routes from Cloud Routers in other regions. + * + * 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; + } + + /** + * A list of the best dynamic routes for this Cloud Router's Virtual Private Cloud (VPC) network in the same region as this Cloud Router. Lists all of the best routes per prefix that are programmed into this region's VPC data plane. When global dynamic routing mode is turned on in the VPC network, this list can include cross-region dynamic routes from Cloud Routers in other regions. + * + * 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; + } + + /** + * A list of the best BGP routes learned by this Cloud Router. It is possible that routes listed might not be programmed into the data plane, if the Google Cloud control plane finds a more optimal route for a prefix than a route learned by this Cloud 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; + } + + /** + * A list of the best BGP routes learned by this Cloud Router. It is possible that routes listed might not be programmed into the data plane, if the Google Cloud control plane finds a more optimal route for a prefix than a route learned by this Cloud 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/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..5f15083e62fa --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Scheduling.php @@ -0,0 +1,600 @@ +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 availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * + * Generated from protobuf field optional int32 availability_domain = 252514344; + */ + protected $availability_domain = 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; + /** + * Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_run_duration = 430839747; + */ + protected $max_run_duration = 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; + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SchedulingOnInstanceStopAction on_instance_stop_action = 529876681; + */ + protected $on_instance_stop_action = 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; + /** + * Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + * + * Generated from protobuf field optional string termination_time = 428082984; + */ + protected $termination_time = 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 int $availability_domain + * Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * @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 \Google\Cloud\Compute\V1\Duration $max_run_duration + * Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration. + * @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 \Google\Cloud\Compute\V1\SchedulingOnInstanceStopAction $on_instance_stop_action + * @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. + * @type string $termination_time + * Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + * } + */ + 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 availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * + * Generated from protobuf field optional int32 availability_domain = 252514344; + * @return int + */ + public function getAvailabilityDomain() + { + return isset($this->availability_domain) ? $this->availability_domain : 0; + } + + public function hasAvailabilityDomain() + { + return isset($this->availability_domain); + } + + public function clearAvailabilityDomain() + { + unset($this->availability_domain); + } + + /** + * Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. + * + * Generated from protobuf field optional int32 availability_domain = 252514344; + * @param int $var + * @return $this + */ + public function setAvailabilityDomain($var) + { + GPBUtil::checkInt32($var); + $this->availability_domain = $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; + } + + /** + * Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_run_duration = 430839747; + * @return \Google\Cloud\Compute\V1\Duration|null + */ + public function getMaxRunDuration() + { + return $this->max_run_duration; + } + + public function hasMaxRunDuration() + { + return isset($this->max_run_duration); + } + + public function clearMaxRunDuration() + { + unset($this->max_run_duration); + } + + /** + * Specifies the max run duration for the given instance. If specified, the instance termination action will be performed at the end of the run duration. + * + * Generated from protobuf field optional .google.cloud.compute.v1.Duration max_run_duration = 430839747; + * @param \Google\Cloud\Compute\V1\Duration $var + * @return $this + */ + public function setMaxRunDuration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\Duration::class); + $this->max_run_duration = $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; + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SchedulingOnInstanceStopAction on_instance_stop_action = 529876681; + * @return \Google\Cloud\Compute\V1\SchedulingOnInstanceStopAction|null + */ + public function getOnInstanceStopAction() + { + return $this->on_instance_stop_action; + } + + public function hasOnInstanceStopAction() + { + return isset($this->on_instance_stop_action); + } + + public function clearOnInstanceStopAction() + { + unset($this->on_instance_stop_action); + } + + /** + * Generated from protobuf field optional .google.cloud.compute.v1.SchedulingOnInstanceStopAction on_instance_stop_action = 529876681; + * @param \Google\Cloud\Compute\V1\SchedulingOnInstanceStopAction $var + * @return $this + */ + public function setOnInstanceStopAction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\SchedulingOnInstanceStopAction::class); + $this->on_instance_stop_action = $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; + } + + /** + * Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + * + * Generated from protobuf field optional string termination_time = 428082984; + * @return string + */ + public function getTerminationTime() + { + return isset($this->termination_time) ? $this->termination_time : ''; + } + + public function hasTerminationTime() + { + return isset($this->termination_time); + } + + public function clearTerminationTime() + { + unset($this->termination_time); + } + + /** + * Specifies the timestamp, when the instance will be terminated, in RFC3339 text format. If specified, the instance termination action will be performed at the termination time. + * + * Generated from protobuf field optional string termination_time = 428082984; + * @param string $var + * @return $this + */ + public function setTerminationTime($var) + { + GPBUtil::checkString($var, True); + $this->termination_time = $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/SchedulingOnInstanceStopAction.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingOnInstanceStopAction.php new file mode 100644 index 000000000000..14119bed879c --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SchedulingOnInstanceStopAction.php @@ -0,0 +1,77 @@ +google.cloud.compute.v1.SchedulingOnInstanceStopAction + */ +class SchedulingOnInstanceStopAction extends \Google\Protobuf\Internal\Message +{ + /** + * If true, the contents of any attached Local SSD disks will be discarded else, the Local SSD data will be preserved when the instance is stopped at the end of the run duration/termination time. + * + * Generated from protobuf field optional bool discard_local_ssd = 319517903; + */ + protected $discard_local_ssd = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $discard_local_ssd + * If true, the contents of any attached Local SSD disks will be discarded else, the Local SSD data will be preserved when the instance is stopped at the end of the run duration/termination time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If true, the contents of any attached Local SSD disks will be discarded else, the Local SSD data will be preserved when the instance is stopped at the end of the run duration/termination time. + * + * 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); + } + + /** + * If true, the contents of any attached Local SSD disks will be discarded else, the Local SSD data will be preserved when the instance is stopped at the end of the run duration/termination time. + * + * 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; + } + +} + 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..cce05ed043c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig.php @@ -0,0 +1,369 @@ +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; + /** + * Generated from protobuf field optional float detection_absolute_qps = 383123174; + */ + protected $detection_absolute_qps = null; + /** + * Generated from protobuf field optional float detection_load_threshold = 430499148; + */ + protected $detection_load_threshold = null; + /** + * Generated from protobuf field optional float detection_relative_to_baseline_qps = 291343749; + */ + protected $detection_relative_to_baseline_qps = 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; + /** + * Configuration options for enabling Adaptive Protection to operate on specified granular traffic units. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig traffic_granularity_configs = 85367358; + */ + private $traffic_granularity_configs; + + /** + * 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 float $detection_absolute_qps + * @type float $detection_load_threshold + * @type float $detection_relative_to_baseline_qps + * @type string $name + * The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the security policy. + * @type array<\Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig>|\Google\Protobuf\Internal\RepeatedField $traffic_granularity_configs + * Configuration options for enabling Adaptive Protection to operate on specified granular traffic units. + * } + */ + 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; + } + + /** + * Generated from protobuf field optional float detection_absolute_qps = 383123174; + * @return float + */ + public function getDetectionAbsoluteQps() + { + return isset($this->detection_absolute_qps) ? $this->detection_absolute_qps : 0.0; + } + + public function hasDetectionAbsoluteQps() + { + return isset($this->detection_absolute_qps); + } + + public function clearDetectionAbsoluteQps() + { + unset($this->detection_absolute_qps); + } + + /** + * Generated from protobuf field optional float detection_absolute_qps = 383123174; + * @param float $var + * @return $this + */ + public function setDetectionAbsoluteQps($var) + { + GPBUtil::checkFloat($var); + $this->detection_absolute_qps = $var; + + return $this; + } + + /** + * Generated from protobuf field optional float detection_load_threshold = 430499148; + * @return float + */ + public function getDetectionLoadThreshold() + { + return isset($this->detection_load_threshold) ? $this->detection_load_threshold : 0.0; + } + + public function hasDetectionLoadThreshold() + { + return isset($this->detection_load_threshold); + } + + public function clearDetectionLoadThreshold() + { + unset($this->detection_load_threshold); + } + + /** + * Generated from protobuf field optional float detection_load_threshold = 430499148; + * @param float $var + * @return $this + */ + public function setDetectionLoadThreshold($var) + { + GPBUtil::checkFloat($var); + $this->detection_load_threshold = $var; + + return $this; + } + + /** + * Generated from protobuf field optional float detection_relative_to_baseline_qps = 291343749; + * @return float + */ + public function getDetectionRelativeToBaselineQps() + { + return isset($this->detection_relative_to_baseline_qps) ? $this->detection_relative_to_baseline_qps : 0.0; + } + + public function hasDetectionRelativeToBaselineQps() + { + return isset($this->detection_relative_to_baseline_qps); + } + + public function clearDetectionRelativeToBaselineQps() + { + unset($this->detection_relative_to_baseline_qps); + } + + /** + * Generated from protobuf field optional float detection_relative_to_baseline_qps = 291343749; + * @param float $var + * @return $this + */ + public function setDetectionRelativeToBaselineQps($var) + { + GPBUtil::checkFloat($var); + $this->detection_relative_to_baseline_qps = $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; + } + + /** + * Configuration options for enabling Adaptive Protection to operate on specified granular traffic units. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig traffic_granularity_configs = 85367358; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTrafficGranularityConfigs() + { + return $this->traffic_granularity_configs; + } + + /** + * Configuration options for enabling Adaptive Protection to operate on specified granular traffic units. + * + * Generated from protobuf field repeated .google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig traffic_granularity_configs = 85367358; + * @param array<\Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTrafficGranularityConfigs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig::class); + $this->traffic_granularity_configs = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig.php new file mode 100644 index 000000000000..8947196b7054 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig.php @@ -0,0 +1,169 @@ +google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig + */ +class SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig extends \Google\Protobuf\Internal\Message +{ + /** + * If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if `value` is empty. + * + * Generated from protobuf field optional bool enable_each_unique_value = 469206341; + */ + protected $enable_each_unique_value = null; + /** + * Type of this configuration. + * Check the Type enum for the list of possible values. + * + * Generated from protobuf field optional string type = 3575610; + */ + protected $type = null; + /** + * Requests that match this value constitute a granular traffic unit. + * + * Generated from protobuf field optional string value = 111972721; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $enable_each_unique_value + * If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if `value` is empty. + * @type string $type + * Type of this configuration. + * Check the Type enum for the list of possible values. + * @type string $value + * Requests that match this value constitute a granular traffic unit. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce(); + parent::__construct($data); + } + + /** + * If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if `value` is empty. + * + * Generated from protobuf field optional bool enable_each_unique_value = 469206341; + * @return bool + */ + public function getEnableEachUniqueValue() + { + return isset($this->enable_each_unique_value) ? $this->enable_each_unique_value : false; + } + + public function hasEnableEachUniqueValue() + { + return isset($this->enable_each_unique_value); + } + + public function clearEnableEachUniqueValue() + { + unset($this->enable_each_unique_value); + } + + /** + * If enabled, traffic matching each unique value for the specified type constitutes a separate traffic unit. It can only be set to true if `value` is empty. + * + * Generated from protobuf field optional bool enable_each_unique_value = 469206341; + * @param bool $var + * @return $this + */ + public function setEnableEachUniqueValue($var) + { + GPBUtil::checkBool($var); + $this->enable_each_unique_value = $var; + + return $this; + } + + /** + * Type of this configuration. + * 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 this configuration. + * 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; + } + + /** + * Requests that match this value constitute a granular traffic unit. + * + * 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); + } + + /** + * Requests that match this value constitute a granular traffic unit. + * + * 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/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig/Type.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig/Type.php new file mode 100644 index 000000000000..a3e1127267f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig/Type.php @@ -0,0 +1,65 @@ +google.cloud.compute.v1.SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig.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 HTTP_HEADER_HOST = 374321891; + */ + const HTTP_HEADER_HOST = 374321891; + /** + * Generated from protobuf enum HTTP_PATH = 311503228; + */ + const HTTP_PATH = 311503228; + /** + * Generated from protobuf enum UNSPECIFIED_TYPE = 53933922; + */ + const UNSPECIFIED_TYPE = 53933922; + + private static $valueToName = [ + self::UNDEFINED_TYPE => 'UNDEFINED_TYPE', + self::HTTP_HEADER_HOST => 'HTTP_HEADER_HOST', + self::HTTP_PATH => 'HTTP_PATH', + 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(Type::class, \Google\Cloud\Compute\V1\SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfigTrafficGranularityConfig_Type::class); + 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..f83715ae86f7 --- /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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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..0a5607a0f2e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptions/EnforceOnKey.php @@ -0,0 +1,105 @@ +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 TLS_JA4_FINGERPRINT = 33724926; + */ + const TLS_JA4_FINGERPRINT = 33724926; + /** + * 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::TLS_JA4_FINGERPRINT => 'TLS_JA4_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..72ddeebad557 --- /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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. + * 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..8ad18bda2019 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig/EnforceOnKeyType.php @@ -0,0 +1,105 @@ +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 TLS_JA4_FINGERPRINT = 33724926; + */ + const TLS_JA4_FINGERPRINT = 33724926; + /** + * 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::TLS_JA4_FINGERPRINT => 'TLS_JA4_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..be89913d3bef --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachment.php @@ -0,0 +1,867 @@ +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; + /** + * The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. If unspecified, the default propagated connection limit is 250. + * + * Generated from protobuf field optional uint32 propagated_connection_limit = 332719230; + */ + protected $propagated_connection_limit = 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 int $propagated_connection_limit + * The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. If unspecified, the default propagated connection limit is 250. + * @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; + } + + /** + * The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. If unspecified, the default propagated connection limit is 250. + * + * Generated from protobuf field optional uint32 propagated_connection_limit = 332719230; + * @return int + */ + public function getPropagatedConnectionLimit() + { + return isset($this->propagated_connection_limit) ? $this->propagated_connection_limit : 0; + } + + public function hasPropagatedConnectionLimit() + { + return isset($this->propagated_connection_limit); + } + + public function clearPropagatedConnectionLimit() + { + unset($this->propagated_connection_limit); + } + + /** + * The number of consumer spokes that connected Private Service Connect endpoints can be propagated to through Network Connectivity Center. This limit lets the service producer limit how many propagated Private Service Connect connections can be established to this service attachment from a single consumer. If the connection preference of the service attachment is ACCEPT_MANUAL, the limit applies to each project or network that is listed in the consumer accept list. If the connection preference of the service attachment is ACCEPT_AUTOMATIC, the limit applies to each project that contains a connected endpoint. If unspecified, the default propagated connection limit is 250. + * + * Generated from protobuf field optional uint32 propagated_connection_limit = 332719230; + * @param int $var + * @return $this + */ + public function setPropagatedConnectionLimit($var) + { + GPBUtil::checkUint32($var); + $this->propagated_connection_limit = $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..ad42591b6345 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/ServiceAttachmentConnectedEndpoint.php @@ -0,0 +1,257 @@ +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 number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to. + * + * Generated from protobuf field optional uint32 propagated_connection_count = 324594130; + */ + protected $propagated_connection_count = 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 $propagated_connection_count + * The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to. + * @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 number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to. + * + * Generated from protobuf field optional uint32 propagated_connection_count = 324594130; + * @return int + */ + public function getPropagatedConnectionCount() + { + return isset($this->propagated_connection_count) ? $this->propagated_connection_count : 0; + } + + public function hasPropagatedConnectionCount() + { + return isset($this->propagated_connection_count); + } + + public function clearPropagatedConnectionCount() + { + unset($this->propagated_connection_count); + } + + /** + * The number of consumer Network Connectivity Center spokes that the connected Private Service Connect endpoint has propagated to. + * + * Generated from protobuf field optional uint32 propagated_connection_count = 324594130; + * @param int $var + * @return $this + */ + public function setPropagatedConnectionCount($var) + { + GPBUtil::checkUint32($var); + $this->propagated_connection_count = $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/SetLabelsRegionSecurityPolicyRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionSecurityPolicyRequest.php new file mode 100644 index 000000000000..013d35adf77e --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SetLabelsRegionSecurityPolicyRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SetLabelsRegionSecurityPolicyRequest + */ +class SetLabelsRegionSecurityPolicyRequest 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\SetLabelsRegionSecurityPolicyRequest + * + * @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..92bbffc8ad3f --- /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 Cloud Storage bucket locations. Only one location can be specified. + * + * 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 Cloud Storage bucket locations. Only one location can be specified. + * @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 Cloud Storage bucket locations. Only one location can be specified. + * + * 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 Cloud Storage bucket locations. Only one location can be specified. + * + * 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..59aeb2e4721b --- /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 in the nearest multi region Cloud Storage 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..d3f309218c82 --- /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 Cloud Storage buckets. Only one location can be specified. + * + * 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 Cloud Storage buckets. Only one location can be specified. + * } + */ + 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 Cloud Storage buckets. Only one location can be specified. + * + * 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 Cloud Storage buckets. Only one location can be specified. + * + * 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/StartInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..b0dd6dd2d23b --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StartInstancesInstanceGroupManagerRequest + */ +class StartInstancesInstanceGroupManagerRequest 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.InstanceGroupManagersStartInstancesRequest instance_group_managers_start_instances_request_resource = 261083819 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_start_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\InstanceGroupManagersStartInstancesRequest $instanceGroupManagersStartInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StartInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersStartInstancesRequest $instanceGroupManagersStartInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStartInstancesRequestResource($instanceGroupManagersStartInstancesRequestResource); + } + + /** + * 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\InstanceGroupManagersStartInstancesRequest $instance_group_managers_start_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.InstanceGroupManagersStartInstancesRequest instance_group_managers_start_instances_request_resource = 261083819 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersStartInstancesRequest|null + */ + public function getInstanceGroupManagersStartInstancesRequestResource() + { + return $this->instance_group_managers_start_instances_request_resource; + } + + public function hasInstanceGroupManagersStartInstancesRequestResource() + { + return isset($this->instance_group_managers_start_instances_request_resource); + } + + public function clearInstanceGroupManagersStartInstancesRequestResource() + { + unset($this->instance_group_managers_start_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersStartInstancesRequest instance_group_managers_start_instances_request_resource = 261083819 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersStartInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersStartInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersStartInstancesRequest::class); + $this->instance_group_managers_start_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/StartInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..f4e976c0811a --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StartInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StartInstancesRegionInstanceGroupManagerRequest + */ +class StartInstancesRegionInstanceGroupManagerRequest 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.RegionInstanceGroupManagersStartInstancesRequest region_instance_group_managers_start_instances_request_resource = 497012118 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_start_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\RegionInstanceGroupManagersStartInstancesRequest $regionInstanceGroupManagersStartInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StartInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStartInstancesRequest $regionInstanceGroupManagersStartInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersStartInstancesRequestResource($regionInstanceGroupManagersStartInstancesRequestResource); + } + + /** + * 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\RegionInstanceGroupManagersStartInstancesRequest $region_instance_group_managers_start_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.RegionInstanceGroupManagersStartInstancesRequest region_instance_group_managers_start_instances_request_resource = 497012118 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStartInstancesRequest|null + */ + public function getRegionInstanceGroupManagersStartInstancesRequestResource() + { + return $this->region_instance_group_managers_start_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersStartInstancesRequestResource() + { + return isset($this->region_instance_group_managers_start_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersStartInstancesRequestResource() + { + unset($this->region_instance_group_managers_start_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersStartInstancesRequest region_instance_group_managers_start_instances_request_resource = 497012118 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStartInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersStartInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStartInstancesRequest::class); + $this->region_instance_group_managers_start_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/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/StopInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..c9ab7c92dc65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StopInstancesInstanceGroupManagerRequest + */ +class StopInstancesInstanceGroupManagerRequest 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.InstanceGroupManagersStopInstancesRequest instance_group_managers_stop_instances_request_resource = 37556877 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_stop_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\InstanceGroupManagersStopInstancesRequest $instanceGroupManagersStopInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StopInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersStopInstancesRequest $instanceGroupManagersStopInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStopInstancesRequestResource($instanceGroupManagersStopInstancesRequestResource); + } + + /** + * 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\InstanceGroupManagersStopInstancesRequest $instance_group_managers_stop_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.InstanceGroupManagersStopInstancesRequest instance_group_managers_stop_instances_request_resource = 37556877 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersStopInstancesRequest|null + */ + public function getInstanceGroupManagersStopInstancesRequestResource() + { + return $this->instance_group_managers_stop_instances_request_resource; + } + + public function hasInstanceGroupManagersStopInstancesRequestResource() + { + return isset($this->instance_group_managers_stop_instances_request_resource); + } + + public function clearInstanceGroupManagersStopInstancesRequestResource() + { + unset($this->instance_group_managers_stop_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersStopInstancesRequest instance_group_managers_stop_instances_request_resource = 37556877 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersStopInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersStopInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersStopInstancesRequest::class); + $this->instance_group_managers_stop_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/StopInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..00cfa7400886 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StopInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.StopInstancesRegionInstanceGroupManagerRequest + */ +class StopInstancesRegionInstanceGroupManagerRequest 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.RegionInstanceGroupManagersStopInstancesRequest region_instance_group_managers_stop_instances_request_resource = 270306882 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_stop_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 The name of the managed instance group. + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStopInstancesRequest $regionInstanceGroupManagersStopInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\StopInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStopInstancesRequest $regionInstanceGroupManagersStopInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersStopInstancesRequestResource($regionInstanceGroupManagersStopInstancesRequestResource); + } + + /** + * 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\RegionInstanceGroupManagersStopInstancesRequest $region_instance_group_managers_stop_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); + } + + /** + * 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.RegionInstanceGroupManagersStopInstancesRequest region_instance_group_managers_stop_instances_request_resource = 270306882 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStopInstancesRequest|null + */ + public function getRegionInstanceGroupManagersStopInstancesRequestResource() + { + return $this->region_instance_group_managers_stop_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersStopInstancesRequestResource() + { + return isset($this->region_instance_group_managers_stop_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersStopInstancesRequestResource() + { + unset($this->region_instance_group_managers_stop_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersStopInstancesRequest region_instance_group_managers_stop_instances_request_resource = 270306882 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStopInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersStopInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersStopInstancesRequest::class); + $this->region_instance_group_managers_stop_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/StoragePool.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/StoragePool.php new file mode 100644 index 000000000000..eca04086efe9 --- /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. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools. + * + * 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. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools. + * @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. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools. + * + * 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. For more information about the size limits, see https://cloud.google.com/compute/docs/disks/storage-pools. + * + * 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..23b8b303eeb9 --- /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; + /** + * [Output Only] Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. For more information, see https://cloud.google.com/compute/docs/disks/storage-pools. + * + * 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 + * [Output Only] Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. For more information, see https://cloud.google.com/compute/docs/disks/storage-pools. + * @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; + } + + /** + * [Output Only] Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. For more information, see https://cloud.google.com/compute/docs/disks/storage-pools. + * + * 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); + } + + /** + * [Output Only] Sum of all the disks' provisioned IOPS, minus some amount that is allowed per disk that is not counted towards pool's IOPS capacity. For more information, see https://cloud.google.com/compute/docs/disks/storage-pools. + * + * 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..e3cb17f55e08 --- /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; + /** + * The internal IPv6 address range that is owned by 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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 + * The internal IPv6 address range that is owned by 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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; + } + + /** + * The internal IPv6 address range that is owned by 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); + } + + /** + * The internal IPv6 address range that is owned by 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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..58ecdd4b63e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/Purpose.php @@ -0,0 +1,110 @@ +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; + /** + * Subnetwork will be used for Migration from one peered VPC to another. (a transient state of subnetwork while migrating resources from one project to another). + * + * Generated from protobuf enum PEER_MIGRATION = 491902225; + */ + const PEER_MIGRATION = 491902225; + /** + * 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::PEER_MIGRATION => 'PEER_MIGRATION', + 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..2dba33f40214 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Subnetwork/StackType.php @@ -0,0 +1,76 @@ +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; + /** + * New VMs in this subnet will only be assigned IPv6 addresses. + * + * Generated from protobuf enum IPV6_ONLY = 79632100; + */ + const IPV6_ONLY = 79632100; + /** + * 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::IPV6_ONLY => 'IPV6_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/SuspendInstancesInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstancesInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..8a40ecc82af6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstancesInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SuspendInstancesInstanceGroupManagerRequest + */ +class SuspendInstancesInstanceGroupManagerRequest 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.InstanceGroupManagersSuspendInstancesRequest instance_group_managers_suspend_instances_request_resource = 46679761 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $instance_group_managers_suspend_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\InstanceGroupManagersSuspendInstancesRequest $instanceGroupManagersSuspendInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SuspendInstancesInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $zone, string $instanceGroupManager, \Google\Cloud\Compute\V1\InstanceGroupManagersSuspendInstancesRequest $instanceGroupManagersSuspendInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setZone($zone) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSuspendInstancesRequestResource($instanceGroupManagersSuspendInstancesRequestResource); + } + + /** + * 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\InstanceGroupManagersSuspendInstancesRequest $instance_group_managers_suspend_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.InstanceGroupManagersSuspendInstancesRequest instance_group_managers_suspend_instances_request_resource = 46679761 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\InstanceGroupManagersSuspendInstancesRequest|null + */ + public function getInstanceGroupManagersSuspendInstancesRequestResource() + { + return $this->instance_group_managers_suspend_instances_request_resource; + } + + public function hasInstanceGroupManagersSuspendInstancesRequestResource() + { + return isset($this->instance_group_managers_suspend_instances_request_resource); + } + + public function clearInstanceGroupManagersSuspendInstancesRequestResource() + { + unset($this->instance_group_managers_suspend_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.InstanceGroupManagersSuspendInstancesRequest instance_group_managers_suspend_instances_request_resource = 46679761 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\InstanceGroupManagersSuspendInstancesRequest $var + * @return $this + */ + public function setInstanceGroupManagersSuspendInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\InstanceGroupManagersSuspendInstancesRequest::class); + $this->instance_group_managers_suspend_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/SuspendInstancesRegionInstanceGroupManagerRequest.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstancesRegionInstanceGroupManagerRequest.php new file mode 100644 index 000000000000..aae80c4f8576 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/SuspendInstancesRegionInstanceGroupManagerRequest.php @@ -0,0 +1,242 @@ +google.cloud.compute.v1.SuspendInstancesRegionInstanceGroupManagerRequest + */ +class SuspendInstancesRegionInstanceGroupManagerRequest 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.RegionInstanceGroupManagersSuspendInstancesRequest region_instance_group_managers_suspend_instances_request_resource = 214250236 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region_instance_group_managers_suspend_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\RegionInstanceGroupManagersSuspendInstancesRequest $regionInstanceGroupManagersSuspendInstancesRequestResource The body resource for this request + * + * @return \Google\Cloud\Compute\V1\SuspendInstancesRegionInstanceGroupManagerRequest + * + * @experimental + */ + public static function build(string $project, string $region, string $instanceGroupManager, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSuspendInstancesRequest $regionInstanceGroupManagersSuspendInstancesRequestResource): self + { + return (new self()) + ->setProject($project) + ->setRegion($region) + ->setInstanceGroupManager($instanceGroupManager) + ->setRegionInstanceGroupManagersSuspendInstancesRequestResource($regionInstanceGroupManagersSuspendInstancesRequestResource); + } + + /** + * 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\RegionInstanceGroupManagersSuspendInstancesRequest $region_instance_group_managers_suspend_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.RegionInstanceGroupManagersSuspendInstancesRequest region_instance_group_managers_suspend_instances_request_resource = 214250236 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSuspendInstancesRequest|null + */ + public function getRegionInstanceGroupManagersSuspendInstancesRequestResource() + { + return $this->region_instance_group_managers_suspend_instances_request_resource; + } + + public function hasRegionInstanceGroupManagersSuspendInstancesRequestResource() + { + return isset($this->region_instance_group_managers_suspend_instances_request_resource); + } + + public function clearRegionInstanceGroupManagersSuspendInstancesRequestResource() + { + unset($this->region_instance_group_managers_suspend_instances_request_resource); + } + + /** + * The body resource for this request + * + * Generated from protobuf field .google.cloud.compute.v1.RegionInstanceGroupManagersSuspendInstancesRequest region_instance_group_managers_suspend_instances_request_resource = 214250236 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSuspendInstancesRequest $var + * @return $this + */ + public function setRegionInstanceGroupManagersSuspendInstancesRequestResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\RegionInstanceGroupManagersSuspendInstancesRequest::class); + $this->region_instance_group_managers_suspend_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/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..dc4a928bb004 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy.php @@ -0,0 +1,823 @@ +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 external Application Load Balancer or Classic Application Load Balancer. For other products use Certificate Manager Certificates instead. 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. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API. Certificate Manager Certificates are not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. + * + * 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; + /** + * Specifies whether TLS 1.3 0-RTT Data ("Early Data") should be accepted for this service. Early Data allows a TLS resumption handshake to include the initial application payload (a HTTP request) alongside the handshake, reducing the effective round trips to "zero". This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). This can improve application performance, especially on networks where interruptions may be common, such as on mobile. Requests with Early Data will have the "Early-Data" HTTP header set on the request, with a value of "1", to allow the backend to determine whether Early Data was included. Note: TLS Early Data may allow requests to be replayed, as the data is sent to the backend before the handshake has fully completed. Applications that allow idempotent HTTP methods to make non-idempotent changes, such as a GET request updating a database, should not accept Early Data on those requests, and reject requests with the "Early-Data: 1" HTTP header by returning a HTTP 425 (Too Early) status code, in order to remain RFC compliant. The default value is DISABLED. + * Check the TlsEarlyData enum for the list of possible values. + * + * Generated from protobuf field optional string tls_early_data = 61108426; + */ + protected $tls_early_data = 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 external Application Load Balancer or Classic Application Load Balancer. For other products use Certificate Manager Certificates instead. 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. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API. Certificate Manager Certificates are not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. + * @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 $tls_early_data + * Specifies whether TLS 1.3 0-RTT Data ("Early Data") should be accepted for this service. Early Data allows a TLS resumption handshake to include the initial application payload (a HTTP request) alongside the handshake, reducing the effective round trips to "zero". This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). This can improve application performance, especially on networks where interruptions may be common, such as on mobile. Requests with Early Data will have the "Early-Data" HTTP header set on the request, with a value of "1", to allow the backend to determine whether Early Data was included. Note: TLS Early Data may allow requests to be replayed, as the data is sent to the backend before the handshake has fully completed. Applications that allow idempotent HTTP methods to make non-idempotent changes, such as a GET request updating a database, should not accept Early Data on those requests, and reject requests with the "Early-Data: 1" HTTP header by returning a HTTP 425 (Too Early) status code, in order to remain RFC compliant. The default value is DISABLED. + * Check the TlsEarlyData enum for the list of possible values. + * @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 external Application Load Balancer or Classic Application Load Balancer. For other products use Certificate Manager Certificates instead. 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 external Application Load Balancer or Classic Application Load Balancer. For other products use Certificate Manager Certificates instead. 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. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API. Certificate Manager Certificates are not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. + * + * 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. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API. Certificate Manager Certificates are not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. + * + * 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; + } + + /** + * Specifies whether TLS 1.3 0-RTT Data ("Early Data") should be accepted for this service. Early Data allows a TLS resumption handshake to include the initial application payload (a HTTP request) alongside the handshake, reducing the effective round trips to "zero". This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). This can improve application performance, especially on networks where interruptions may be common, such as on mobile. Requests with Early Data will have the "Early-Data" HTTP header set on the request, with a value of "1", to allow the backend to determine whether Early Data was included. Note: TLS Early Data may allow requests to be replayed, as the data is sent to the backend before the handshake has fully completed. Applications that allow idempotent HTTP methods to make non-idempotent changes, such as a GET request updating a database, should not accept Early Data on those requests, and reject requests with the "Early-Data: 1" HTTP header by returning a HTTP 425 (Too Early) status code, in order to remain RFC compliant. The default value is DISABLED. + * Check the TlsEarlyData enum for the list of possible values. + * + * Generated from protobuf field optional string tls_early_data = 61108426; + * @return string + */ + public function getTlsEarlyData() + { + return isset($this->tls_early_data) ? $this->tls_early_data : ''; + } + + public function hasTlsEarlyData() + { + return isset($this->tls_early_data); + } + + public function clearTlsEarlyData() + { + unset($this->tls_early_data); + } + + /** + * Specifies whether TLS 1.3 0-RTT Data ("Early Data") should be accepted for this service. Early Data allows a TLS resumption handshake to include the initial application payload (a HTTP request) alongside the handshake, reducing the effective round trips to "zero". This applies to TLS 1.3 connections over TCP (HTTP/2) as well as over UDP (QUIC/h3). This can improve application performance, especially on networks where interruptions may be common, such as on mobile. Requests with Early Data will have the "Early-Data" HTTP header set on the request, with a value of "1", to allow the backend to determine whether Early Data was included. Note: TLS Early Data may allow requests to be replayed, as the data is sent to the backend before the handshake has fully completed. Applications that allow idempotent HTTP methods to make non-idempotent changes, such as a GET request updating a database, should not accept Early Data on those requests, and reject requests with the "Early-Data: 1" HTTP header by returning a HTTP 425 (Too Early) status code, in order to remain RFC compliant. The default value is DISABLED. + * Check the TlsEarlyData enum for the list of possible values. + * + * Generated from protobuf field optional string tls_early_data = 61108426; + * @param string $var + * @return $this + */ + public function setTlsEarlyData($var) + { + GPBUtil::checkString($var, True); + $this->tls_early_data = $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/TargetHttpsProxy/TlsEarlyData.php b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy/TlsEarlyData.php new file mode 100644 index 000000000000..d99c42227d41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetHttpsProxy/TlsEarlyData.php @@ -0,0 +1,78 @@ +google.cloud.compute.v1.TargetHttpsProxy.TlsEarlyData + */ +class TlsEarlyData +{ + /** + * A value indicating that the enum field is not set. + * + * Generated from protobuf enum UNDEFINED_TLS_EARLY_DATA = 0; + */ + const UNDEFINED_TLS_EARLY_DATA = 0; + /** + * TLS 1.3 Early Data is not advertised, and any (invalid) attempts to send Early Data will be rejected by closing the connection. + * + * Generated from protobuf enum DISABLED = 516696700; + */ + const DISABLED = 516696700; + /** + * This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE). This mode does not enforce any other limitations for requests with Early Data. The application owner should validate that Early Data is acceptable for a given request path. + * + * Generated from protobuf enum PERMISSIVE = 504345247; + */ + const PERMISSIVE = 504345247; + /** + * This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE) without query parameters. Requests that send Early Data with non-idempotent HTTP methods or with query parameters will be rejected with a HTTP 425. + * + * Generated from protobuf enum STRICT = 308826825; + */ + const STRICT = 308826825; + /** + * This enables TLS 1.3 Early Data for requests with any HTTP method including non-idempotent methods list POST. This mode does not enforce any other limitations. This may be valuable for gRPC use cases. However, we do not recommend this method unless you have evaluated your security stance and mitigated the risk of replay attacks using other mechanisms. + * + * Generated from protobuf enum UNRESTRICTED = 457266100; + */ + const UNRESTRICTED = 457266100; + + private static $valueToName = [ + self::UNDEFINED_TLS_EARLY_DATA => 'UNDEFINED_TLS_EARLY_DATA', + self::DISABLED => 'DISABLED', + self::PERMISSIVE => 'PERMISSIVE', + self::STRICT => 'STRICT', + self::UNRESTRICTED => 'UNRESTRICTED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(TlsEarlyData::class, \Google\Cloud\Compute\V1\TargetHttpsProxy_TlsEarlyData::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..a1e6d6891f56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/TargetPool/SessionAffinity.php @@ -0,0 +1,113 @@ +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; + /** + * Strong cookie-based affinity. Connections bearing the same cookie will be served by the same backend VM while that VM remains healthy, as long as the cookie has not expired. + * + * Generated from protobuf enum STRONG_COOKIE_AFFINITY = 438628091; + */ + const STRONG_COOKIE_AFFINITY = 438628091; + + 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', + self::STRONG_COOKIE_AFFINITY => 'STRONG_COOKIE_AFFINITY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no 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..b2e808b07a12 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UrlMap.php @@ -0,0 +1,707 @@ +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; + /** + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap. For example, consider a UrlMap with the following configuration: - defaultCustomErrorResponsePolicy containing policies for responding to 5xx and 4xx errors - A PathMatcher configured for *.example.com has defaultCustomErrorResponsePolicy for 4xx. If a request for http://www.example.com/ encounters a 404, the policy in pathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the request for http://www.example.com/ encounters a 502, the policy in UrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request that does not match any host in *.example.com such as http://www.myotherexample.com/, encounters a 404, UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy default_custom_error_response_policy = 81266089; + */ + protected $default_custom_error_response_policy = 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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\CustomErrorResponsePolicy $default_custom_error_response_policy + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap. For example, consider a UrlMap with the following configuration: - defaultCustomErrorResponsePolicy containing policies for responding to 5xx and 4xx errors - A PathMatcher configured for *.example.com has defaultCustomErrorResponsePolicy for 4xx. If a request for http://www.example.com/ encounters a 404, the policy in pathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the request for http://www.example.com/ encounters a 502, the policy in UrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request that does not match any host in *.example.com such as http://www.myotherexample.com/, encounters a 404, UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * @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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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; + } + + /** + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap. For example, consider a UrlMap with the following configuration: - defaultCustomErrorResponsePolicy containing policies for responding to 5xx and 4xx errors - A PathMatcher configured for *.example.com has defaultCustomErrorResponsePolicy for 4xx. If a request for http://www.example.com/ encounters a 404, the policy in pathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the request for http://www.example.com/ encounters a 502, the policy in UrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request that does not match any host in *.example.com such as http://www.myotherexample.com/, encounters a 404, UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy default_custom_error_response_policy = 81266089; + * @return \Google\Cloud\Compute\V1\CustomErrorResponsePolicy|null + */ + public function getDefaultCustomErrorResponsePolicy() + { + return $this->default_custom_error_response_policy; + } + + public function hasDefaultCustomErrorResponsePolicy() + { + return isset($this->default_custom_error_response_policy); + } + + public function clearDefaultCustomErrorResponsePolicy() + { + unset($this->default_custom_error_response_policy); + } + + /** + * defaultCustomErrorResponsePolicy specifies how the Load Balancer returns error responses when BackendServiceor BackendBucket responds with an error. This policy takes effect at the load balancer level and applies only when no policy has been defined for the error code at lower levels like PathMatcher, RouteRule and PathRule within this UrlMap. For example, consider a UrlMap with the following configuration: - defaultCustomErrorResponsePolicy containing policies for responding to 5xx and 4xx errors - A PathMatcher configured for *.example.com has defaultCustomErrorResponsePolicy for 4xx. If a request for http://www.example.com/ encounters a 404, the policy in pathMatcher.defaultCustomErrorResponsePolicy will be enforced. When the request for http://www.example.com/ encounters a 502, the policy in UrlMap.defaultCustomErrorResponsePolicy will be enforced. When a request that does not match any host in *.example.com such as http://www.myotherexample.com/, encounters a 404, UrlMap.defaultCustomErrorResponsePolicy takes effect. When used in conjunction with defaultRouteAction.retryPolicy, retries take precedence. Only once all retries are exhausted, the defaultCustomErrorResponsePolicy is applied. While attempting a retry, if load balancer is successful in reaching the service, the defaultCustomErrorResponsePolicy is ignored and the response from the service is returned to the client. defaultCustomErrorResponsePolicy is supported only for global external Application Load Balancers. + * + * Generated from protobuf field optional .google.cloud.compute.v1.CustomErrorResponsePolicy default_custom_error_response_policy = 81266089; + * @param \Google\Cloud\Compute\V1\CustomErrorResponsePolicy $var + * @return $this + */ + public function setDefaultCustomErrorResponsePolicy($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\CustomErrorResponsePolicy::class); + $this->default_custom_error_response_policy = $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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can 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..e16c4e12c13a --- /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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. 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. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. 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..5386845ed5c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/Purpose.php @@ -0,0 +1,110 @@ +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; + /** + * Subnetwork will be used for Migration from one peered VPC to another. (a transient state of subnetwork while migrating resources from one project to another). + * + * Generated from protobuf enum PEER_MIGRATION = 491902225; + */ + const PEER_MIGRATION = 491902225; + /** + * 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::PEER_MIGRATION => 'PEER_MIGRATION', + 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..b666209a9344 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/UsableSubnetwork/StackType.php @@ -0,0 +1,71 @@ +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; + /** + * New VMs in this subnet will only be assigned IPv6 addresses. + * + * Generated from protobuf enum IPV6_ONLY = 79632100; + */ + const IPV6_ONLY = 79632100; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + self::IPV6_ONLY => 'IPV6_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..293a5a2297df --- /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, IPV6_ONLY. If not specified, IPV4_ONLY is used if the gateway IP version is IPV4, or IPV4_IPV6 if the gateway IP version is IPV6. + * 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, IPV6_ONLY. If not specified, IPV4_ONLY is used if the gateway IP version is IPV4, or IPV4_IPV6 if the gateway IP version is IPV6. + * 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, IPV6_ONLY. If not specified, IPV4_ONLY is used if the gateway IP version is IPV4, or IPV4_IPV6 if the gateway IP version is IPV6. + * 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, IPV6_ONLY. If not specified, IPV4_ONLY is used if the gateway IP version is IPV4, or IPV4_IPV6 if the gateway IP version is IPV6. + * 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..8ffe4618cba1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/VpnGateway/StackType.php @@ -0,0 +1,71 @@ +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; + /** + * Enable VPN gateway with only IPv6 protocol. + * + * Generated from protobuf enum IPV6_ONLY = 79632100; + */ + const IPV6_ONLY = 79632100; + + private static $valueToName = [ + self::UNDEFINED_STACK_TYPE => 'UNDEFINED_STACK_TYPE', + self::IPV4_IPV6 => 'IPV4_IPV6', + self::IPV4_ONLY => 'IPV4_ONLY', + self::IPV6_ONLY => 'IPV6_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..a0562b754ee7 --- /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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * + * 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. This field can be set only for Classic VPN tunnels. + * + * 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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * + * 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. This field can be set only for Classic VPN tunnels. + * + * 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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * @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. This field can be set only for Classic VPN tunnels. + * @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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * @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. This field can be set only for Classic VPN tunnels. + * @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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * + * 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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * + * 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. This field can be set only for Classic VPN tunnels. + * + * 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. This field can be set only for Classic VPN tunnels. + * + * 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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * + * 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 for Classic VPN tunnels. This field is output only for HA VPN tunnels. + * + * 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. This field can be set only for Classic VPN tunnels. + * + * 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. This field can be set only for Classic VPN tunnels. + * + * 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..37b5652b88e6 --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..65f6bda9e111 --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..338ec4c5312c --- /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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * + * 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, or its unique numeric identifier. + * + * 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..d3d6d98ae1a8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warning/Code.php @@ -0,0 +1,253 @@ +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; + /** + * Quota information is not available to client requests (e.g: regions.list). + * + * Generated from protobuf enum QUOTA_INFO_UNAVAILABLE = 304294182; + */ + const QUOTA_INFO_UNAVAILABLE = 304294182; + /** + * 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::QUOTA_INFO_UNAVAILABLE => 'QUOTA_INFO_UNAVAILABLE', + 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..a146c7726aab --- /dev/null +++ b/owl-bot-staging/Compute/V1/proto/src/Google/Cloud/Compute/V1/Warnings/Code.php @@ -0,0 +1,253 @@ +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; + /** + * Quota information is not available to client requests (e.g: regions.list). + * + * Generated from protobuf enum QUOTA_INFO_UNAVAILABLE = 304294182; + */ + const QUOTA_INFO_UNAVAILABLE = 304294182; + /** + * 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::QUOTA_INFO_UNAVAILABLE => 'QUOTA_INFO_UNAVAILABLE', + 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..94cb56256ff7 --- /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. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. 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. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. 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. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. 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. Don't configure session affinity if you're using weighted traffic splitting. If you do, the weighted traffic splitting configuration takes precedence. 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..21d3b92d004a --- /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..a5d7d3df7298 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $acceleratorTypesClient->aggregatedList($request); + + 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..1e16626c898f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/get.php @@ -0,0 +1,76 @@ +setAcceleratorType($acceleratorType) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var AcceleratorType $response */ + $response = $acceleratorTypesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..84d198bd7550 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AcceleratorTypesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $acceleratorTypesClient->list($request); + + 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..ab91bd34ab07 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $addressesClient->aggregatedList($request); + + 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..53d4e3e874e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/delete.php @@ -0,0 +1,85 @@ +setAddress($address) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $addressesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b2e0d786a9dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/get.php @@ -0,0 +1,76 @@ +setAddress($address) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Address $response */ + $response = $addressesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4b8e02c5e46b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/insert.php @@ -0,0 +1,85 @@ +setAddressResource($addressResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $addressesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..09d27b1c16b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $addressesClient->list($request); + + 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..4052a086cb6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/move.php @@ -0,0 +1,88 @@ +setAddress($address) + ->setProject($project) + ->setRegion($region) + ->setRegionAddressesMoveRequestResource($regionAddressesMoveRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $addressesClient->move($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..39ecac0fadb2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AddressesClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $addressesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..44516b3d2456 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoscalersClient->aggregatedList($request); + + 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..3062f456b832 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/delete.php @@ -0,0 +1,85 @@ +setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoscalersClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5b78726f0ac6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/get.php @@ -0,0 +1,76 @@ +setAutoscaler($autoscaler) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Autoscaler $response */ + $response = $autoscalersClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2e650f93ced9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/insert.php @@ -0,0 +1,85 @@ +setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoscalersClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6da9d67b02f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $autoscalersClient->list($request); + + 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..e925ecd8794d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/patch.php @@ -0,0 +1,85 @@ +setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoscalersClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..385405c71b47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/AutoscalersClient/update.php @@ -0,0 +1,85 @@ +setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $autoscalersClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..201dc3450479 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/add_signed_url_key.php @@ -0,0 +1,85 @@ +setBackendBucket($backendBucket) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->addSignedUrlKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3a4c878f972c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete.php @@ -0,0 +1,82 @@ +setBackendBucket($backendBucket) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..14494320b973 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/delete_signed_url_key.php @@ -0,0 +1,88 @@ +setBackendBucket($backendBucket) + ->setKeyName($keyName) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->deleteSignedUrlKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c8bd8f6092d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get.php @@ -0,0 +1,73 @@ +setBackendBucket($backendBucket) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var BackendBucket $response */ + $response = $backendBucketsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4ba3e63b3cbf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backendBucketsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7af7e26201e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/insert.php @@ -0,0 +1,82 @@ +setBackendBucketResource($backendBucketResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9274c36e6f93 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backendBucketsClient->list($request); + + 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..718d127c6d8d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/patch.php @@ -0,0 +1,85 @@ +setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..33c8eff51b9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_edge_security_policy.php @@ -0,0 +1,85 @@ +setBackendBucket($backendBucket) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->setEdgeSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1d83c696cc3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backendBucketsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3206a535837c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $backendBucketsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3b094843c3da --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendBucketsClient/update.php @@ -0,0 +1,85 @@ +setBackendBucket($backendBucket) + ->setBackendBucketResource($backendBucketResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendBucketsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aba0c8106b5a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/add_signed_url_key.php @@ -0,0 +1,85 @@ +setBackendService($backendService) + ->setProject($project) + ->setSignedUrlKeyResource($signedUrlKeyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->addSignedUrlKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dab93dea3dc9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backendServicesClient->aggregatedList($request); + + 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..189f050142bd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete.php @@ -0,0 +1,82 @@ +setBackendService($backendService) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bb1896174df6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/delete_signed_url_key.php @@ -0,0 +1,88 @@ +setBackendService($backendService) + ->setKeyName($keyName) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->deleteSignedUrlKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cb384af980fa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get.php @@ -0,0 +1,73 @@ +setBackendService($backendService) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var BackendService $response */ + $response = $backendServicesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0bc3699f1291 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_health.php @@ -0,0 +1,76 @@ +setBackendService($backendService) + ->setProject($project) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var BackendServiceGroupHealth $response */ + $response = $backendServicesClient->getHealth($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..97469eb77bd4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backendServicesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a3e09176978e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/insert.php @@ -0,0 +1,82 @@ +setBackendServiceResource($backendServiceResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..40c96f72fbf1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backendServicesClient->list($request); + + 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..e428bc2e54bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/list_usable.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $backendServicesClient->listUsable($request); + + 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..f86698c63f1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/patch.php @@ -0,0 +1,85 @@ +setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..79a7f9511bf5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_edge_security_policy.php @@ -0,0 +1,85 @@ +setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->setEdgeSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7d43b17997eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $backendServicesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c10c1e910f04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/set_security_policy.php @@ -0,0 +1,85 @@ +setBackendService($backendService) + ->setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->setSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4da1bf568561 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $backendServicesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1eb51e941c9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/BackendServicesClient/update.php @@ -0,0 +1,85 @@ +setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $backendServicesClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aba509547a10 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $diskTypesClient->aggregatedList($request); + + 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..36d3b3e18d0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/get.php @@ -0,0 +1,76 @@ +setDiskType($diskType) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var DiskType $response */ + $response = $diskTypesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d2ec735ec4ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DiskTypesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $diskTypesClient->list($request); + + 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..03acd810fefb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/add_resource_policies.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setDisksAddResourcePoliciesRequestResource($disksAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->addResourcePolicies($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8fa28b9b7ad6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $disksClient->aggregatedList($request); + + 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..250b2fffe312 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/bulk_insert.php @@ -0,0 +1,85 @@ +setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->bulkInsert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2d47e827aec6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/create_snapshot.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setProject($project) + ->setSnapshotResource($snapshotResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->createSnapshot($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..67ee85ed57ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/delete.php @@ -0,0 +1,85 @@ +setDisk($disk) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6b1bab9271e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get.php @@ -0,0 +1,76 @@ +setDisk($disk) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Disk $response */ + $response = $disksClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..10d1e8c034f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $disksClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3a8b840c0ae6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/insert.php @@ -0,0 +1,85 @@ +setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..78bc35d5d24a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $disksClient->list($request); + + 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..e77e6a4c03cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/remove_resource_policies.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setDisksRemoveResourcePoliciesRequestResource($disksRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->removeResourcePolicies($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ac37da279c5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/resize.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setDisksResizeRequestResource($disksResizeRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->resize($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bde7d4520cf9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $disksClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..05ad8f10b7b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c4a8d2f9ef56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/start_async_replication.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setDisksStartAsyncReplicationRequestResource($disksStartAsyncReplicationRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->startAsyncReplication($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2ef60b36be89 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_async_replication.php @@ -0,0 +1,85 @@ +setDisk($disk) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->stopAsyncReplication($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3ef88ae5b722 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/stop_group_async_replication.php @@ -0,0 +1,85 @@ +setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->stopGroupAsyncReplication($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b0042b569fa9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $disksClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dad2d9aa7db8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/DisksClient/update.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $disksClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5cb18f0b0922 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/delete.php @@ -0,0 +1,82 @@ +setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $externalVpnGatewaysClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2b92de250d4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/get.php @@ -0,0 +1,73 @@ +setExternalVpnGateway($externalVpnGateway) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var ExternalVpnGateway $response */ + $response = $externalVpnGatewaysClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b3b5278745a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/insert.php @@ -0,0 +1,82 @@ +setExternalVpnGatewayResource($externalVpnGatewayResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $externalVpnGatewaysClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..443ba54f5afb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $externalVpnGatewaysClient->list($request); + + 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..3f4d85b4e1d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $externalVpnGatewaysClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..35264375182c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $externalVpnGatewaysClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c729e9993913 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_association.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->addAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..46badc93ce15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/add_rule.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->addRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b3f9639f63d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/clone_rules.php @@ -0,0 +1,79 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->cloneRules($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..77713732e4aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/delete.php @@ -0,0 +1,79 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b6b3c6ac3e9b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get.php @@ -0,0 +1,70 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicy $response */ + $response = $firewallPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9123b395eb47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_association.php @@ -0,0 +1,70 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicyAssociation $response */ + $response = $firewallPoliciesClient->getAssociation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7b1df90bc1da --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_iam_policy.php @@ -0,0 +1,70 @@ +setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $firewallPoliciesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..013aacce6e41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/get_rule.php @@ -0,0 +1,70 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicyRule $response */ + $response = $firewallPoliciesClient->getRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c763d8e5a9d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/insert.php @@ -0,0 +1,82 @@ +setFirewallPolicyResource($firewallPolicyResource) + ->setParentId($parentId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..59a26e75883b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list.php @@ -0,0 +1,60 @@ +list($request); + + 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..743c5d00cfc4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/list_associations.php @@ -0,0 +1,57 @@ +listAssociations($request); + 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..19172ce6d051 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/move.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setParentId($parentId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->move($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..588a1b38ffdb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0984ac92abe3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/patch_rule.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->patchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0516be64e916 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_association.php @@ -0,0 +1,79 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->removeAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f2857b30e27a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/remove_rule.php @@ -0,0 +1,79 @@ +setFirewallPolicy($firewallPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallPoliciesClient->removeRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..554002b0979a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/set_iam_policy.php @@ -0,0 +1,73 @@ +setGlobalOrganizationSetPolicyRequestResource($globalOrganizationSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $firewallPoliciesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c17821a6c80 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallPoliciesClient/test_iam_permissions.php @@ -0,0 +1,73 @@ +setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $firewallPoliciesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..06067e40cd55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/delete.php @@ -0,0 +1,82 @@ +setFirewall($firewall) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..34d9e8fc2f57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/get.php @@ -0,0 +1,73 @@ +setFirewall($firewall) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Firewall $response */ + $response = $firewallsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6ee0ab133efe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/insert.php @@ -0,0 +1,82 @@ +setFirewallResource($firewallResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9bbd8f927eca --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $firewallsClient->list($request); + + 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..81807129443f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/patch.php @@ -0,0 +1,85 @@ +setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8190830d8f37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/FirewallsClient/update.php @@ -0,0 +1,85 @@ +setFirewall($firewall) + ->setFirewallResource($firewallResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $firewallsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fc4ed396b8b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $forwardingRulesClient->aggregatedList($request); + + 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..175cf8358c39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/delete.php @@ -0,0 +1,85 @@ +setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $forwardingRulesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..05c460ee7cfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/get.php @@ -0,0 +1,76 @@ +setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var ForwardingRule $response */ + $response = $forwardingRulesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5fa421eac59d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/insert.php @@ -0,0 +1,85 @@ +setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $forwardingRulesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..738db2bb0dea --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $forwardingRulesClient->list($request); + + 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..bd451c7f4f44 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/patch.php @@ -0,0 +1,88 @@ +setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $forwardingRulesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c24c9e7c4286 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $forwardingRulesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c9df41524023 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ForwardingRulesClient/set_target.php @@ -0,0 +1,88 @@ +setForwardingRule($forwardingRule) + ->setProject($project) + ->setRegion($region) + ->setTargetReferenceResource($targetReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $forwardingRulesClient->setTarget($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cb708638ad43 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/delete.php @@ -0,0 +1,82 @@ +setAddress($address) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalAddressesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ae8aa1424ae1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/get.php @@ -0,0 +1,73 @@ +setAddress($address) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Address $response */ + $response = $globalAddressesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..36774e4b16e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/insert.php @@ -0,0 +1,82 @@ +setAddressResource($addressResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalAddressesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..43b375e5b7ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalAddressesClient->list($request); + + 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..0e16b69bae30 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/move.php @@ -0,0 +1,85 @@ +setAddress($address) + ->setGlobalAddressesMoveRequestResource($globalAddressesMoveRequestResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalAddressesClient->move($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2532b9343a57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalAddressesClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalAddressesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ba4b9050ecbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/delete.php @@ -0,0 +1,82 @@ +setForwardingRule($forwardingRule) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalForwardingRulesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bdbb6ed35556 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/get.php @@ -0,0 +1,73 @@ +setForwardingRule($forwardingRule) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var ForwardingRule $response */ + $response = $globalForwardingRulesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7b48ab370b88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/insert.php @@ -0,0 +1,82 @@ +setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalForwardingRulesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..49fe71f979e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalForwardingRulesClient->list($request); + + 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..280cc73f25c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/patch.php @@ -0,0 +1,85 @@ +setForwardingRule($forwardingRule) + ->setForwardingRuleResource($forwardingRuleResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalForwardingRulesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e07d5fcbb5be --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalForwardingRulesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0300922c803b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalForwardingRulesClient/set_target.php @@ -0,0 +1,85 @@ +setForwardingRule($forwardingRule) + ->setProject($project) + ->setTargetReferenceResource($targetReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalForwardingRulesClient->setTarget($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a7e87d179704 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php @@ -0,0 +1,87 @@ +setGlobalNetworkEndpointGroupsAttachEndpointsRequestResource( + $globalNetworkEndpointGroupsAttachEndpointsRequestResource + ) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalNetworkEndpointGroupsClient->attachNetworkEndpoints($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..50c5fa1246c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/delete.php @@ -0,0 +1,82 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalNetworkEndpointGroupsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f2d9daa03d7d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php @@ -0,0 +1,87 @@ +setGlobalNetworkEndpointGroupsDetachEndpointsRequestResource( + $globalNetworkEndpointGroupsDetachEndpointsRequestResource + ) + ->setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalNetworkEndpointGroupsClient->detachNetworkEndpoints($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4e6ad8fec038 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/get.php @@ -0,0 +1,73 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var NetworkEndpointGroup $response */ + $response = $globalNetworkEndpointGroupsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9661cb8920dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/insert.php @@ -0,0 +1,82 @@ +setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalNetworkEndpointGroupsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ba992584fe88 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalNetworkEndpointGroupsClient->list($request); + + 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..99de33d74ba5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php @@ -0,0 +1,76 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalNetworkEndpointGroupsClient->listNetworkEndpoints($request); + + 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..2dca350c1b49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalOperationsClient->aggregatedList($request); + + 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..b15fa9b73784 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/delete.php @@ -0,0 +1,73 @@ +setOperation($operation) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var DeleteGlobalOperationResponse $response */ + $response = $globalOperationsClient->delete($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c2aa320edc18 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/get.php @@ -0,0 +1,73 @@ +setOperation($operation) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $globalOperationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1280879385fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalOperationsClient->list($request); + + 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..407028d522cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOperationsClient/wait.php @@ -0,0 +1,73 @@ +setOperation($operation) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $globalOperationsClient->wait($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..604994843999 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/delete.php @@ -0,0 +1,70 @@ +setOperation($operation); + + // Call the API and handle any network failures. + try { + /** @var DeleteGlobalOrganizationOperationResponse $response */ + $response = $globalOrganizationOperationsClient->delete($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e623abd2b42c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/get.php @@ -0,0 +1,70 @@ +setOperation($operation); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $globalOrganizationOperationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..814b1a27e546 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalOrganizationOperationsClient/list.php @@ -0,0 +1,60 @@ +list($request); + + 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..c1fa64d228e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalPublicDelegatedPrefixesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0cb50fca761e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix); + + // Call the API and handle any network failures. + try { + /** @var PublicDelegatedPrefix $response */ + $response = $globalPublicDelegatedPrefixesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1033ee082ab1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalPublicDelegatedPrefixesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..733b12388a12 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $globalPublicDelegatedPrefixesClient->list($request); + + 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..a9477cc664e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $globalPublicDelegatedPrefixesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6fa4d5d35dfd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $healthChecksClient->aggregatedList($request); + + 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..3168558a2922 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/delete.php @@ -0,0 +1,82 @@ +setHealthCheck($healthCheck) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $healthChecksClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d3e25040a2af --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/get.php @@ -0,0 +1,73 @@ +setHealthCheck($healthCheck) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var HealthCheck $response */ + $response = $healthChecksClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d6ebbb6565aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/insert.php @@ -0,0 +1,82 @@ +setHealthCheckResource($healthCheckResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $healthChecksClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..08ae33784beb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $healthChecksClient->list($request); + + 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..5ca7a0eb5a20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/patch.php @@ -0,0 +1,85 @@ +setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $healthChecksClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..804c89cb31f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/HealthChecksClient/update.php @@ -0,0 +1,85 @@ +setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $healthChecksClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..37c1060708c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImageFamilyViewsClient/get.php @@ -0,0 +1,76 @@ +setFamily($family) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var ImageFamilyView $response */ + $response = $imageFamilyViewsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..722a586b175c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/delete.php @@ -0,0 +1,82 @@ +setImage($image) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $imagesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3c0f9e977643 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/deprecate.php @@ -0,0 +1,85 @@ +setDeprecationStatusResource($deprecationStatusResource) + ->setImage($image) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $imagesClient->deprecate($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1e968f73f90e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get.php @@ -0,0 +1,73 @@ +setImage($image) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Image $response */ + $response = $imagesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8557fed2f3e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_from_family.php @@ -0,0 +1,73 @@ +setFamily($family) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Image $response */ + $response = $imagesClient->getFromFamily($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6c994cebf3ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $imagesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0c3865c8fc5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/insert.php @@ -0,0 +1,82 @@ +setImageResource($imageResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $imagesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f092ef08243f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $imagesClient->list($request); + + 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..c81acb941b17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/patch.php @@ -0,0 +1,85 @@ +setImage($image) + ->setImageResource($imageResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $imagesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..014ae21d66d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $imagesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8bf4a13a1ae1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $imagesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..90601d019499 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ImagesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $imagesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1d9e3eaacf04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php @@ -0,0 +1,92 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagerResizeRequestsClient->cancel($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..90fd57d0b7cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php @@ -0,0 +1,92 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagerResizeRequestsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aaef1d3a7b86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php @@ -0,0 +1,83 @@ +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(); + + // Prepare the request message. + $request = (new GetInstanceGroupManagerResizeRequestRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setResizeRequest($resizeRequest) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var InstanceGroupManagerResizeRequest $response */ + $response = $instanceGroupManagerResizeRequestsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8afa90b62f53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php @@ -0,0 +1,88 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResizeRequestResource($instanceGroupManagerResizeRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagerResizeRequestsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a51e47b7168d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagerResizeRequestsClient/list.php @@ -0,0 +1,79 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupManagerResizeRequestsClient->list($request); + + 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..96b6e176affd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/abandon_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersAbandonInstancesRequestResource( + $instanceGroupManagersAbandonInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->abandonInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9f9baa170156 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupManagersClient->aggregatedList($request); + + 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..bbb3932ebad2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersApplyUpdatesRequestResource( + $instanceGroupManagersApplyUpdatesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->applyUpdatesToInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f76a1e910c05 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/create_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersCreateInstancesRequestResource( + $instanceGroupManagersCreateInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->createInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b02e95964735 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete.php @@ -0,0 +1,85 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dcf30d90755f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeleteInstancesRequestResource( + $instanceGroupManagersDeleteInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->deleteInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9a067964a8ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersDeletePerInstanceConfigsReqResource( + $instanceGroupManagersDeletePerInstanceConfigsReqResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->deletePerInstanceConfigs($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1fa69dabaaa5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/get.php @@ -0,0 +1,76 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var InstanceGroupManager $response */ + $response = $instanceGroupManagersClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..673eacba19d0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/insert.php @@ -0,0 +1,85 @@ +setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c591bc4af78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupManagersClient->list($request); + + 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..4dc93cfaff9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_errors.php @@ -0,0 +1,79 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupManagersClient->listErrors($request); + + 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..b07a2b7c2756 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_managed_instances.php @@ -0,0 +1,82 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupManagersClient->listManagedInstances($request); + + 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..c139e5c9fd1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php @@ -0,0 +1,82 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupManagersClient->listPerInstanceConfigs($request); + + 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..fa919db72aa1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch.php @@ -0,0 +1,88 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9a74fd02a62b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersPatchPerInstanceConfigsReqResource( + $instanceGroupManagersPatchPerInstanceConfigsReqResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->patchPerInstanceConfigs($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..31e3fd11c498 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/recreate_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersRecreateInstancesRequestResource( + $instanceGroupManagersRecreateInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->recreateInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c1c4c8aa3dce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resize.php @@ -0,0 +1,92 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setSize($size) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->resize($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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/resume_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resume_instances.php new file mode 100644 index 000000000000..450cdf53a828 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/resume_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersResumeInstancesRequestResource( + $instanceGroupManagersResumeInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->resumeInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + resume_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_ResumeInstances_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..82e7e449c6f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_instance_template.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetInstanceTemplateRequestResource( + $instanceGroupManagersSetInstanceTemplateRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->setInstanceTemplate($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4c288309b671 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/set_target_pools.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSetTargetPoolsRequestResource( + $instanceGroupManagersSetTargetPoolsRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->setTargetPools($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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/start_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/start_instances.php new file mode 100644 index 000000000000..646b7c8ff331 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/start_instances.php @@ -0,0 +1,90 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStartInstancesRequestResource( + $instanceGroupManagersStartInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->startInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + start_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_StartInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/stop_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/stop_instances.php new file mode 100644 index 000000000000..65d96d82547c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/stop_instances.php @@ -0,0 +1,90 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStopInstancesRequestResource( + $instanceGroupManagersStopInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->stopInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + stop_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_StopInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/suspend_instances.php b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/suspend_instances.php new file mode 100644 index 000000000000..aec4e6e4b778 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/suspend_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSuspendInstancesRequestResource( + $instanceGroupManagersSuspendInstancesRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->suspendInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $zone = '[ZONE]'; + + suspend_instances_sample($instanceGroupManager, $project, $zone); +} +// [END compute_v1_generated_InstanceGroupManagers_SuspendInstances_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..c0d09a14cff1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersUpdatePerInstanceConfigsReqResource( + $instanceGroupManagersUpdatePerInstanceConfigsReqResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupManagersClient->updatePerInstanceConfigs($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bca581c56329 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/add_instances.php @@ -0,0 +1,88 @@ +setInstanceGroup($instanceGroup) + ->setInstanceGroupsAddInstancesRequestResource($instanceGroupsAddInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupsClient->addInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..81b56577c845 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupsClient->aggregatedList($request); + + 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..ab39c91fa8c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/delete.php @@ -0,0 +1,85 @@ +setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ec0d77896c3a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/get.php @@ -0,0 +1,76 @@ +setInstanceGroup($instanceGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var InstanceGroup $response */ + $response = $instanceGroupsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..75744ef35772 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/insert.php @@ -0,0 +1,85 @@ +setInstanceGroupResource($instanceGroupResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e2cddedf030e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupsClient->list($request); + + 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..6a7a96d2a23f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/list_instances.php @@ -0,0 +1,82 @@ +setInstanceGroup($instanceGroup) + ->setInstanceGroupsListInstancesRequestResource($instanceGroupsListInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceGroupsClient->listInstances($request); + + 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..313e27fa6dd6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/remove_instances.php @@ -0,0 +1,88 @@ +setInstanceGroup($instanceGroup) + ->setInstanceGroupsRemoveInstancesRequestResource($instanceGroupsRemoveInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupsClient->removeInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..49bcc5ccb0e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceGroupsClient/set_named_ports.php @@ -0,0 +1,88 @@ +setInstanceGroup($instanceGroup) + ->setInstanceGroupsSetNamedPortsRequestResource($instanceGroupsSetNamedPortsRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceGroupsClient->setNamedPorts($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c81fbfed409d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var InstanceSettings $response */ + $response = $instanceSettingsServiceClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4835889e2276 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceSettingsServiceClient/patch.php @@ -0,0 +1,85 @@ +setInstanceSettingsResource($instanceSettingsResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceSettingsServiceClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f591f2ce2113 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceTemplatesClient->aggregatedList($request); + + 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..417c0b27a41e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/delete.php @@ -0,0 +1,82 @@ +setInstanceTemplate($instanceTemplate) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceTemplatesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..79a3ef2e78b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get.php @@ -0,0 +1,73 @@ +setInstanceTemplate($instanceTemplate) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var InstanceTemplate $response */ + $response = $instanceTemplatesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..96c408b50c05 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $instanceTemplatesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..256b286dd5b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/insert.php @@ -0,0 +1,82 @@ +setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instanceTemplatesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cbc629d25e6f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instanceTemplatesClient->list($request); + + 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..e735bbf6e2c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $instanceTemplatesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f91ecc12625b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstanceTemplatesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $instanceTemplatesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4f37cbd2d46b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_access_config.php @@ -0,0 +1,95 @@ +setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->addAccessConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2fda90dbc139 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/add_resource_policies.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesAddResourcePoliciesRequestResource($instancesAddResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->addResourcePolicies($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..eb59a678f2ec --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instancesClient->aggregatedList($request); + + 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..f8dc5081255f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/attach_disk.php @@ -0,0 +1,88 @@ +setAttachedDiskResource($attachedDiskResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->attachDisk($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cce94b38d62a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/bulk_insert.php @@ -0,0 +1,85 @@ +setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->bulkInsert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a2a8cf0767f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0e2cdc428453 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/delete_access_config.php @@ -0,0 +1,96 @@ +setAccessConfig($accessConfig) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->deleteAccessConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d6df7b3cae4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/detach_disk.php @@ -0,0 +1,92 @@ +setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->detachDisk($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dced17724210 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get.php @@ -0,0 +1,76 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Instance $response */ + $response = $instancesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..32fa80a687af --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_effective_firewalls.php @@ -0,0 +1,83 @@ +setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var InstancesGetEffectiveFirewallsResponse $response */ + $response = $instancesClient->getEffectiveFirewalls($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d6a8f86503ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_guest_attributes.php @@ -0,0 +1,76 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var GuestAttributes $response */ + $response = $instancesClient->getGuestAttributes($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..790e777a6806 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $instancesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5bb25161c6a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_screenshot.php @@ -0,0 +1,76 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Screenshot $response */ + $response = $instancesClient->getScreenshot($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5d97efebc4d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_serial_port_output.php @@ -0,0 +1,76 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var SerialPortOutput $response */ + $response = $instancesClient->getSerialPortOutput($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..54507441939b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/get_shielded_instance_identity.php @@ -0,0 +1,79 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var ShieldedInstanceIdentity $response */ + $response = $instancesClient->getShieldedInstanceIdentity($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..86e599bad369 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/insert.php @@ -0,0 +1,85 @@ +setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..22cf6b5ca6d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instancesClient->list($request); + + 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..41b21f47a288 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/list_referrers.php @@ -0,0 +1,79 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instancesClient->listReferrers($request); + + 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..53852ad513c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/perform_maintenance.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->performMaintenance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aabef64880db --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/remove_resource_policies.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesRemoveResourcePoliciesRequestResource($instancesRemoveResourcePoliciesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->removeResourcePolicies($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..107a9670fade --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/reset.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->reset($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8dd9131cdea4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/resume.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->resume($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1cc02fcf836b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/send_diagnostic_interrupt.php @@ -0,0 +1,76 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var SendDiagnosticInterruptInstanceResponse $response */ + $response = $instancesClient->sendDiagnosticInterrupt($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d1a9a9a03d0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_deletion_protection.php @@ -0,0 +1,85 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setDeletionProtection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2d7d5e635213 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_disk_auto_delete.php @@ -0,0 +1,96 @@ +setAutoDelete($autoDelete) + ->setDeviceName($deviceName) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setDiskAutoDelete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f4565114a1c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $instancesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c65d89389ceb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_labels.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetLabelsRequestResource($instancesSetLabelsRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e0fe596487e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_resources.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetMachineResourcesRequestResource($instancesSetMachineResourcesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setMachineResources($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6edc76b4d72f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_machine_type.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetMachineTypeRequestResource($instancesSetMachineTypeRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setMachineType($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..03965795108f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_metadata.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setMetadataResource($metadataResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setMetadata($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..feaf12c31c13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_min_cpu_platform.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetMinCpuPlatformRequestResource($instancesSetMinCpuPlatformRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setMinCpuPlatform($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8f80eae08537 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_name.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetNameRequestResource($instancesSetNameRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setName($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b5ce3bef7668 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_scheduling.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setProject($project) + ->setSchedulingResource($schedulingResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setScheduling($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2a9c5de61d28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_security_policy.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetSecurityPolicyRequestResource($instancesSetSecurityPolicyRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7d7a26f9bf58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_service_account.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesSetServiceAccountRequestResource($instancesSetServiceAccountRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setServiceAccount($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d93bfc506bbf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php @@ -0,0 +1,91 @@ +setInstance($instance) + ->setProject($project) + ->setShieldedInstanceIntegrityPolicyResource($shieldedInstanceIntegrityPolicyResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setShieldedInstanceIntegrityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..33b07e63854c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/set_tags.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setProject($project) + ->setTagsResource($tagsResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->setTags($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2a238689f896 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/simulate_maintenance_event.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->simulateMaintenanceEvent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e7e4cf1317a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->start($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8f0b4b71e350 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/start_with_encryption_key.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstancesStartWithEncryptionKeyRequestResource($instancesStartWithEncryptionKeyRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->startWithEncryptionKey($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..df676ad53219 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/stop.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->stop($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e372ee3dd4d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/suspend.php @@ -0,0 +1,85 @@ +setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->suspend($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aa6025bfcbc2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $instancesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f50b22fa2d0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update.php @@ -0,0 +1,88 @@ +setInstance($instance) + ->setInstanceResource($instanceResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a1e9a6104879 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_access_config.php @@ -0,0 +1,95 @@ +setAccessConfigResource($accessConfigResource) + ->setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->updateAccessConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f113e6c4ed86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_display_device.php @@ -0,0 +1,88 @@ +setDisplayDeviceResource($displayDeviceResource) + ->setInstance($instance) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->updateDisplayDevice($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ab0cabfd25e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_network_interface.php @@ -0,0 +1,95 @@ +setInstance($instance) + ->setNetworkInterface($networkInterface) + ->setNetworkInterfaceResource($networkInterfaceResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->updateNetworkInterface($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..104eab631aef --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstancesClient/update_shielded_instance_config.php @@ -0,0 +1,91 @@ +setInstance($instance) + ->setProject($project) + ->setShieldedInstanceConfigResource($shieldedInstanceConfigResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instancesClient->updateShieldedInstanceConfig($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2053ca9c6a67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instantSnapshotsClient->aggregatedList($request); + + 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..ccbaa8e7d5d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/delete.php @@ -0,0 +1,85 @@ +setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instantSnapshotsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..673143c50412 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get.php @@ -0,0 +1,76 @@ +setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var InstantSnapshot $response */ + $response = $instantSnapshotsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..384abe63de37 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $instantSnapshotsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7b770fc87d5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/insert.php @@ -0,0 +1,85 @@ +setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instantSnapshotsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0a2a3522fa30 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $instantSnapshotsClient->list($request); + + 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..7b8ddeea5c5a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $instantSnapshotsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0f3dd644405f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetLabelsRequestResource($zoneSetLabelsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $instantSnapshotsClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2d9ee5a58b9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InstantSnapshotsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $instantSnapshotsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e0ee1111378e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $interconnectAttachmentsClient->aggregatedList($request); + + 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..dcfc7a0e9802 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/delete.php @@ -0,0 +1,85 @@ +setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectAttachmentsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8ab4a678e93a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/get.php @@ -0,0 +1,76 @@ +setInterconnectAttachment($interconnectAttachment) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var InterconnectAttachment $response */ + $response = $interconnectAttachmentsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..230b993972dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/insert.php @@ -0,0 +1,85 @@ +setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectAttachmentsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..496814e8a686 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $interconnectAttachmentsClient->list($request); + + 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..85a0b27b3b2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/patch.php @@ -0,0 +1,88 @@ +setInterconnectAttachment($interconnectAttachment) + ->setInterconnectAttachmentResource($interconnectAttachmentResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectAttachmentsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5f83fac73425 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectAttachmentsClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectAttachmentsClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b5835e3ce32e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/get.php @@ -0,0 +1,73 @@ +setInterconnectLocation($interconnectLocation) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var InterconnectLocation $response */ + $response = $interconnectLocationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..01586c201274 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectLocationsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $interconnectLocationsClient->list($request); + + 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..4352eca8c813 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/get.php @@ -0,0 +1,73 @@ +setInterconnectRemoteLocation($interconnectRemoteLocation) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var InterconnectRemoteLocation $response */ + $response = $interconnectRemoteLocationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d17adb9144df --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectRemoteLocationsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $interconnectRemoteLocationsClient->list($request); + + 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..915d9e1f29c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/delete.php @@ -0,0 +1,82 @@ +setInterconnect($interconnect) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5025fb393030 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get.php @@ -0,0 +1,73 @@ +setInterconnect($interconnect) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Interconnect $response */ + $response = $interconnectsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ce3f727bf2d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_diagnostics.php @@ -0,0 +1,73 @@ +setInterconnect($interconnect) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var InterconnectsGetDiagnosticsResponse $response */ + $response = $interconnectsClient->getDiagnostics($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..48d90a1a2d56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/get_macsec_config.php @@ -0,0 +1,73 @@ +setInterconnect($interconnect) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var InterconnectsGetMacsecConfigResponse $response */ + $response = $interconnectsClient->getMacsecConfig($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..92d764016cfd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/insert.php @@ -0,0 +1,82 @@ +setInterconnectResource($interconnectResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d79c12762e4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $interconnectsClient->list($request); + + 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..9bbf5616990b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/patch.php @@ -0,0 +1,85 @@ +setInterconnect($interconnect) + ->setInterconnectResource($interconnectResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0c0dfd0eb9d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/InterconnectsClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $interconnectsClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fe6c9248ffad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/get.php @@ -0,0 +1,73 @@ +setLicenseCode($licenseCode) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var LicenseCode $response */ + $response = $licenseCodesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fc3dba9652ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicenseCodesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $licenseCodesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d197fbfe5ba1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/delete.php @@ -0,0 +1,82 @@ +setLicense($license) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $licensesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fc6e87cb0726 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get.php @@ -0,0 +1,73 @@ +setLicense($license) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var License $response */ + $response = $licensesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..df4a19925ed3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $licensesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cc963179907b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/insert.php @@ -0,0 +1,82 @@ +setLicenseResource($licenseResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $licensesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bd571ba2921b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $licensesClient->list($request); + + 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..ee39a456ac19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $licensesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..975c9a6becb9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/LicensesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $licensesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1f1e797caa6c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/delete.php @@ -0,0 +1,82 @@ +setMachineImage($machineImage) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $machineImagesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c31e9dd06599 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get.php @@ -0,0 +1,73 @@ +setMachineImage($machineImage) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var MachineImage $response */ + $response = $machineImagesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c58abb30c2c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $machineImagesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..155fdf5d0b3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/insert.php @@ -0,0 +1,82 @@ +setMachineImageResource($machineImageResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $machineImagesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9b3c613d0b12 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $machineImagesClient->list($request); + + 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..c6cb50c3b8d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $machineImagesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..449a2171e576 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineImagesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $machineImagesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..230152911aab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $machineTypesClient->aggregatedList($request); + + 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..62c860530b56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/get.php @@ -0,0 +1,76 @@ +setMachineType($machineType) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var MachineType $response */ + $response = $machineTypesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5984be806d00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/MachineTypesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $machineTypesClient->list($request); + + 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..87afed201c17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkAttachmentsClient->aggregatedList($request); + + 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..48d52ce247ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/delete.php @@ -0,0 +1,85 @@ +setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkAttachmentsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e3695e3f4451 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get.php @@ -0,0 +1,76 @@ +setNetworkAttachment($networkAttachment) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var NetworkAttachment $response */ + $response = $networkAttachmentsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c05f4e980292 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $networkAttachmentsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d190aa9527b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/insert.php @@ -0,0 +1,85 @@ +setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkAttachmentsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..730764e17f17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkAttachmentsClient->list($request); + + 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..2ddf0b60a5ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/patch.php @@ -0,0 +1,88 @@ +setNetworkAttachment($networkAttachment) + ->setNetworkAttachmentResource($networkAttachmentResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkAttachmentsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..03b06caf04eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $networkAttachmentsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c921a4c38249 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkAttachmentsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $networkAttachmentsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..88ace0d76f9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkEdgeSecurityServicesClient->aggregatedList($request); + + 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..cd5ca5a6ea63 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/delete.php @@ -0,0 +1,85 @@ +setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEdgeSecurityServicesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2cbd6730ca60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/get.php @@ -0,0 +1,76 @@ +setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var NetworkEdgeSecurityService $response */ + $response = $networkEdgeSecurityServicesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..deb7c144ef32 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/insert.php @@ -0,0 +1,85 @@ +setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEdgeSecurityServicesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..eb712648723a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEdgeSecurityServicesClient/patch.php @@ -0,0 +1,88 @@ +setNetworkEdgeSecurityService($networkEdgeSecurityService) + ->setNetworkEdgeSecurityServiceResource($networkEdgeSecurityServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEdgeSecurityServicesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0be8908f8b5a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkEndpointGroupsClient->aggregatedList($request); + + 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..57c5be3dbb4f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php @@ -0,0 +1,93 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsAttachEndpointsRequestResource( + $networkEndpointGroupsAttachEndpointsRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEndpointGroupsClient->attachNetworkEndpoints($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c24b2f662207 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/delete.php @@ -0,0 +1,85 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEndpointGroupsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..51710ef370b3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php @@ -0,0 +1,93 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsDetachEndpointsRequestResource( + $networkEndpointGroupsDetachEndpointsRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEndpointGroupsClient->detachNetworkEndpoints($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..48c94f3b4552 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/get.php @@ -0,0 +1,76 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var NetworkEndpointGroup $response */ + $response = $networkEndpointGroupsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..22794c739208 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/insert.php @@ -0,0 +1,85 @@ +setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkEndpointGroupsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..13273f19b391 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkEndpointGroupsClient->list($request); + + 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..262dc68b8a03 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php @@ -0,0 +1,87 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setNetworkEndpointGroupsListEndpointsRequestResource( + $networkEndpointGroupsListEndpointsRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkEndpointGroupsClient->listNetworkEndpoints($request); + + 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..2ff6037824ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $networkEndpointGroupsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e9a57b0555f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_association.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->addAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1a44923f2b34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/add_rule.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->addRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8a0c95e6f610 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/clone_rules.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->cloneRules($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4d70a620c084 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/delete.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..49996a7733b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get.php @@ -0,0 +1,73 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicy $response */ + $response = $networkFirewallPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..490fe8c38c67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_association.php @@ -0,0 +1,73 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicyAssociation $response */ + $response = $networkFirewallPoliciesClient->getAssociation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ea28f514910a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $networkFirewallPoliciesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5773b24a97e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/get_rule.php @@ -0,0 +1,73 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicyRule $response */ + $response = $networkFirewallPoliciesClient->getRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fec9deeb784c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/insert.php @@ -0,0 +1,82 @@ +setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1644cc1ad822 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networkFirewallPoliciesClient->list($request); + + 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..a19bc80426e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fb28dc856358 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/patch_rule.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->patchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..799a8b6e25be --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_association.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->removeAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0b449cebf005 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/remove_rule.php @@ -0,0 +1,82 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networkFirewallPoliciesClient->removeRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f22dd9b0f104 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $networkFirewallPoliciesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..df67b2e0cb91 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $networkFirewallPoliciesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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/NetworkProfilesClient/get.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkProfilesClient/get.php new file mode 100644 index 000000000000..a2f0bac0d766 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkProfilesClient/get.php @@ -0,0 +1,73 @@ +setNetworkProfile($networkProfile) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var NetworkProfile $response */ + $response = $networkProfilesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $networkProfile = '[NETWORK_PROFILE]'; + $project = '[PROJECT]'; + + get_sample($networkProfile, $project); +} +// [END compute_v1_generated_NetworkProfiles_Get_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/NetworkProfilesClient/list.php b/owl-bot-staging/Compute/V1/samples/V1/NetworkProfilesClient/list.php new file mode 100644 index 000000000000..46257f42f691 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworkProfilesClient/list.php @@ -0,0 +1,70 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var NetworkProfilesListResponse $response */ + $response = $networkProfilesClient->list($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $project = '[PROJECT]'; + + list_sample($project); +} +// [END compute_v1_generated_NetworkProfiles_List_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..8251f0325fdf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/add_peering.php @@ -0,0 +1,85 @@ +setNetwork($network) + ->setNetworksAddPeeringRequestResource($networksAddPeeringRequestResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->addPeering($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..79657543c150 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/delete.php @@ -0,0 +1,82 @@ +setNetwork($network) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bd3a0626a86a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get.php @@ -0,0 +1,73 @@ +setNetwork($network) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Network $response */ + $response = $networksClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e9728a385b3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/get_effective_firewalls.php @@ -0,0 +1,73 @@ +setNetwork($network) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var NetworksGetEffectiveFirewallsResponse $response */ + $response = $networksClient->getEffectiveFirewalls($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a81986eeecf9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/insert.php @@ -0,0 +1,82 @@ +setNetworkResource($networkResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..64101d33d932 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networksClient->list($request); + + 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..3b21b314853f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/list_peering_routes.php @@ -0,0 +1,76 @@ +setNetwork($network) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $networksClient->listPeeringRoutes($request); + + 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..50763a4e444a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/patch.php @@ -0,0 +1,85 @@ +setNetwork($network) + ->setNetworkResource($networkResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b7c8a4b2d5ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/remove_peering.php @@ -0,0 +1,85 @@ +setNetwork($network) + ->setNetworksRemovePeeringRequestResource($networksRemovePeeringRequestResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->removePeering($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bad1d07a91b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/switch_to_custom_mode.php @@ -0,0 +1,82 @@ +setNetwork($network) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->switchToCustomMode($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c6e043ad2c2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NetworksClient/update_peering.php @@ -0,0 +1,85 @@ +setNetwork($network) + ->setNetworksUpdatePeeringRequestResource($networksUpdatePeeringRequestResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $networksClient->updatePeering($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dd5f9178c1aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/add_nodes.php @@ -0,0 +1,88 @@ +setNodeGroup($nodeGroup) + ->setNodeGroupsAddNodesRequestResource($nodeGroupsAddNodesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->addNodes($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..59e58a6e926b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeGroupsClient->aggregatedList($request); + + 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..fc2f2251a87f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete.php @@ -0,0 +1,85 @@ +setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9b0993b7454f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/delete_nodes.php @@ -0,0 +1,88 @@ +setNodeGroup($nodeGroup) + ->setNodeGroupsDeleteNodesRequestResource($nodeGroupsDeleteNodesRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->deleteNodes($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d47e2a3f1234 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get.php @@ -0,0 +1,76 @@ +setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var NodeGroup $response */ + $response = $nodeGroupsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3c906c1c9da1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $nodeGroupsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ed5d0c29c969 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/insert.php @@ -0,0 +1,88 @@ +setInitialNodeCount($initialNodeCount) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..084f8086b219 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeGroupsClient->list($request); + + 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..156914efe488 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/list_nodes.php @@ -0,0 +1,79 @@ +setNodeGroup($nodeGroup) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeGroupsClient->listNodes($request); + + 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..c02163ac9989 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/patch.php @@ -0,0 +1,88 @@ +setNodeGroup($nodeGroup) + ->setNodeGroupResource($nodeGroupResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dd11eb8bb702 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/perform_maintenance.php @@ -0,0 +1,88 @@ +setNodeGroup($nodeGroup) + ->setNodeGroupsPerformMaintenanceRequestResource($nodeGroupsPerformMaintenanceRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->performMaintenance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..293052265cb3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $nodeGroupsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4f36d6961047 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/set_node_template.php @@ -0,0 +1,88 @@ +setNodeGroup($nodeGroup) + ->setNodeGroupsSetNodeTemplateRequestResource($nodeGroupsSetNodeTemplateRequestResource) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->setNodeTemplate($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..53968983bdb8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/simulate_maintenance_event.php @@ -0,0 +1,90 @@ +setNodeGroup($nodeGroup) + ->setNodeGroupsSimulateMaintenanceEventRequestResource( + $nodeGroupsSimulateMaintenanceEventRequestResource + ) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeGroupsClient->simulateMaintenanceEvent($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fbabb43b84fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeGroupsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $nodeGroupsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6123d70ddf3a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeTemplatesClient->aggregatedList($request); + + 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..da1ce893ffbf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/delete.php @@ -0,0 +1,85 @@ +setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeTemplatesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f679ec3c4e7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get.php @@ -0,0 +1,76 @@ +setNodeTemplate($nodeTemplate) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var NodeTemplate $response */ + $response = $nodeTemplatesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5264daa8e805 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $nodeTemplatesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fba565293d2d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/insert.php @@ -0,0 +1,85 @@ +setNodeTemplateResource($nodeTemplateResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $nodeTemplatesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7bdfb470fb9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeTemplatesClient->list($request); + + 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..0feded6159c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $nodeTemplatesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3ba04eb76492 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTemplatesClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $nodeTemplatesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2b9433430eee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeTypesClient->aggregatedList($request); + + 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..feda0cc48bf1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/get.php @@ -0,0 +1,76 @@ +setNodeType($nodeType) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var NodeType $response */ + $response = $nodeTypesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e7b91dfd4331 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/NodeTypesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $nodeTypesClient->list($request); + + 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..767c8d479fb8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $packetMirroringsClient->aggregatedList($request); + + 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..e206e5c7ec41 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/delete.php @@ -0,0 +1,85 @@ +setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $packetMirroringsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fecb728b0941 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/get.php @@ -0,0 +1,76 @@ +setPacketMirroring($packetMirroring) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PacketMirroring $response */ + $response = $packetMirroringsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1a80af96740a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/insert.php @@ -0,0 +1,85 @@ +setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $packetMirroringsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..243186e5c11e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $packetMirroringsClient->list($request); + + 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..e25f2c8aff13 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/patch.php @@ -0,0 +1,88 @@ +setPacketMirroring($packetMirroring) + ->setPacketMirroringResource($packetMirroringResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $packetMirroringsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2f434e683949 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PacketMirroringsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $packetMirroringsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..331547609dae --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_host.php @@ -0,0 +1,79 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->disableXpnHost($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..43c765140b9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/disable_xpn_resource.php @@ -0,0 +1,82 @@ +setProject($project) + ->setProjectsDisableXpnResourceRequestResource($projectsDisableXpnResourceRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->disableXpnResource($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f6142785ac53 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_host.php @@ -0,0 +1,79 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->enableXpnHost($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bf61350710b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/enable_xpn_resource.php @@ -0,0 +1,82 @@ +setProject($project) + ->setProjectsEnableXpnResourceRequestResource($projectsEnableXpnResourceRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->enableXpnResource($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5b37b9687e3d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get.php @@ -0,0 +1,70 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Project $response */ + $response = $projectsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7cc4937e924d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_host.php @@ -0,0 +1,70 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var Project $response */ + $response = $projectsClient->getXpnHost($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8ee093e0dc65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/get_xpn_resources.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $projectsClient->getXpnResources($request); + + 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..4e96378f8d4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/list_xpn_hosts.php @@ -0,0 +1,76 @@ +setProject($project) + ->setProjectsListXpnHostsRequestResource($projectsListXpnHostsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $projectsClient->listXpnHosts($request); + + 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..951c3866f2d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_disk.php @@ -0,0 +1,82 @@ +setDiskMoveRequestResource($diskMoveRequestResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->moveDisk($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f41c78fb5fa1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/move_instance.php @@ -0,0 +1,82 @@ +setInstanceMoveRequestResource($instanceMoveRequestResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->moveInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..de4cbfb92b96 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_cloud_armor_tier.php @@ -0,0 +1,82 @@ +setProject($project) + ->setProjectsSetCloudArmorTierRequestResource($projectsSetCloudArmorTierRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->setCloudArmorTier($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dfeccc18131b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_common_instance_metadata.php @@ -0,0 +1,82 @@ +setMetadataResource($metadataResource) + ->setProject($project); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->setCommonInstanceMetadata($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2c51f50931cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_default_network_tier.php @@ -0,0 +1,82 @@ +setProject($project) + ->setProjectsSetDefaultNetworkTierRequestResource($projectsSetDefaultNetworkTierRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->setDefaultNetworkTier($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..031e1f2ccdc8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ProjectsClient/set_usage_export_bucket.php @@ -0,0 +1,82 @@ +setProject($project) + ->setUsageExportLocationResource($usageExportLocationResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $projectsClient->setUsageExportBucket($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d66da7e21550 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/announce.php @@ -0,0 +1,82 @@ +setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicAdvertisedPrefixesClient->announce($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5082f6ffe693 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicAdvertisedPrefixesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e930257f377f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + + // Call the API and handle any network failures. + try { + /** @var PublicAdvertisedPrefix $response */ + $response = $publicAdvertisedPrefixesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..024126f3766d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicAdvertisedPrefixesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d18c250d7a29 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $publicAdvertisedPrefixesClient->list($request); + + 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..1443ab1c0094 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix) + ->setPublicAdvertisedPrefixResource($publicAdvertisedPrefixResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicAdvertisedPrefixesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a43127cce2f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicAdvertisedPrefixesClient/withdraw.php @@ -0,0 +1,82 @@ +setProject($project) + ->setPublicAdvertisedPrefix($publicAdvertisedPrefix); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicAdvertisedPrefixesClient->withdraw($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bbbecbaa917c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $publicDelegatedPrefixesClient->aggregatedList($request); + + 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..ffedf0bae847 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/announce.php @@ -0,0 +1,85 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicDelegatedPrefixesClient->announce($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5b2b4c5820cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicDelegatedPrefixesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b9170967ac22 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PublicDelegatedPrefix $response */ + $response = $publicDelegatedPrefixesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f4f7289d7bec --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicDelegatedPrefixesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d270fe0c1124 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $publicDelegatedPrefixesClient->list($request); + + 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..9686ed0101ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setPublicDelegatedPrefixResource($publicDelegatedPrefixResource) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicDelegatedPrefixesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4b2904d6074e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/PublicDelegatedPrefixesClient/withdraw.php @@ -0,0 +1,85 @@ +setProject($project) + ->setPublicDelegatedPrefix($publicDelegatedPrefix) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $publicDelegatedPrefixesClient->withdraw($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a57ed8fbefb4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/delete.php @@ -0,0 +1,85 @@ +setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionAutoscalersClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aa4cfedf6b89 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/get.php @@ -0,0 +1,76 @@ +setAutoscaler($autoscaler) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Autoscaler $response */ + $response = $regionAutoscalersClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a71583c4fecb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/insert.php @@ -0,0 +1,85 @@ +setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionAutoscalersClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..12a9b277068c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionAutoscalersClient->list($request); + + 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..47877b5ad058 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/patch.php @@ -0,0 +1,85 @@ +setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionAutoscalersClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..68fcfe8bb4e4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionAutoscalersClient/update.php @@ -0,0 +1,85 @@ +setAutoscalerResource($autoscalerResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionAutoscalersClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a396449133dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/delete.php @@ -0,0 +1,85 @@ +setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionBackendServicesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..abb656f1bba5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get.php @@ -0,0 +1,76 @@ +setBackendService($backendService) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var BackendService $response */ + $response = $regionBackendServicesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6c029db12f2b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_health.php @@ -0,0 +1,79 @@ +setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setResourceGroupReferenceResource($resourceGroupReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var BackendServiceGroupHealth $response */ + $response = $regionBackendServicesClient->getHealth($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b771851bae83 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionBackendServicesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..edfa1169258e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/insert.php @@ -0,0 +1,85 @@ +setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionBackendServicesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..272fa8f72a47 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionBackendServicesClient->list($request); + + 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..e810cc176130 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/list_usable.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionBackendServicesClient->listUsable($request); + + 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..4945d0f20333 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/patch.php @@ -0,0 +1,88 @@ +setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionBackendServicesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e571e30d4e48 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionBackendServicesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..99c0ad606659 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/set_security_policy.php @@ -0,0 +1,88 @@ +setBackendService($backendService) + ->setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionBackendServicesClient->setSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1e82d5efd2fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $regionBackendServicesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..37d1574ccf72 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionBackendServicesClient/update.php @@ -0,0 +1,88 @@ +setBackendService($backendService) + ->setBackendServiceResource($backendServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionBackendServicesClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f1383e10fc04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionCommitmentsClient->aggregatedList($request); + + 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..33c8691de9fb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/get.php @@ -0,0 +1,76 @@ +setCommitment($commitment) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Commitment $response */ + $response = $regionCommitmentsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..99463e346dec --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/insert.php @@ -0,0 +1,85 @@ +setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionCommitmentsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f19f4ef67484 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionCommitmentsClient->list($request); + + 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..7c6997c6ef25 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionCommitmentsClient/update.php @@ -0,0 +1,88 @@ +setCommitment($commitment) + ->setCommitmentResource($commitmentResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionCommitmentsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6d2091408368 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/get.php @@ -0,0 +1,76 @@ +setDiskType($diskType) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var DiskType $response */ + $response = $regionDiskTypesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9e56f3964cf1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDiskTypesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionDiskTypesClient->list($request); + + 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..9bd8d4b6baa0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/add_resource_policies.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksAddResourcePoliciesRequestResource($regionDisksAddResourcePoliciesRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->addResourcePolicies($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..25229ec75cb6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/bulk_insert.php @@ -0,0 +1,85 @@ +setBulkInsertDiskResourceResource($bulkInsertDiskResourceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->bulkInsert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..79ad8ea94717 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/create_snapshot.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setSnapshotResource($snapshotResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->createSnapshot($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5adc1ded4254 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/delete.php @@ -0,0 +1,85 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..32555d1017ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get.php @@ -0,0 +1,76 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Disk $response */ + $response = $regionDisksClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..539408be2620 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionDisksClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..30afa31bb8bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/insert.php @@ -0,0 +1,85 @@ +setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..835456549bdb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionDisksClient->list($request); + + 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..2c57a0e1a706 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/remove_resource_policies.php @@ -0,0 +1,90 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksRemoveResourcePoliciesRequestResource( + $regionDisksRemoveResourcePoliciesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->removeResourcePolicies($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..284459f0b749 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/resize.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksResizeRequestResource($regionDisksResizeRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->resize($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..72e45f92b127 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionDisksClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2ab83ab41758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6a4c937ccf1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/start_async_replication.php @@ -0,0 +1,90 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region) + ->setRegionDisksStartAsyncReplicationRequestResource( + $regionDisksStartAsyncReplicationRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->startAsyncReplication($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ebffcb5b212a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_async_replication.php @@ -0,0 +1,85 @@ +setDisk($disk) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->stopAsyncReplication($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9e2896dcc12c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/stop_group_async_replication.php @@ -0,0 +1,85 @@ +setDisksStopGroupAsyncReplicationResourceResource($disksStopGroupAsyncReplicationResourceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->stopGroupAsyncReplication($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..71e3429b19cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $regionDisksClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..11a694e2b7c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionDisksClient/update.php @@ -0,0 +1,88 @@ +setDisk($disk) + ->setDiskResource($diskResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionDisksClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4689861e23b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/delete.php @@ -0,0 +1,85 @@ +setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthCheckServicesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3a696c500205 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/get.php @@ -0,0 +1,76 @@ +setHealthCheckService($healthCheckService) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var HealthCheckService $response */ + $response = $regionHealthCheckServicesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6a3167f212e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/insert.php @@ -0,0 +1,85 @@ +setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthCheckServicesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..14a9f266c342 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionHealthCheckServicesClient->list($request); + + 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..1294659933cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthCheckServicesClient/patch.php @@ -0,0 +1,88 @@ +setHealthCheckService($healthCheckService) + ->setHealthCheckServiceResource($healthCheckServiceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthCheckServicesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..26edcca49469 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/delete.php @@ -0,0 +1,85 @@ +setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthChecksClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..51c6a7da3f3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/get.php @@ -0,0 +1,76 @@ +setHealthCheck($healthCheck) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var HealthCheck $response */ + $response = $regionHealthChecksClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3a173c2b932c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/insert.php @@ -0,0 +1,85 @@ +setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthChecksClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fb8e986bd03a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionHealthChecksClient->list($request); + + 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..22f66a9d89d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/patch.php @@ -0,0 +1,88 @@ +setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthChecksClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..754cd88dd2b7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionHealthChecksClient/update.php @@ -0,0 +1,88 @@ +setHealthCheck($healthCheck) + ->setHealthCheckResource($healthCheckResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionHealthChecksClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2639d56cef3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersAbandonInstancesRequestResource( + $regionInstanceGroupManagersAbandonInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->abandonInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c8b061c055f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersApplyUpdatesRequestResource( + $regionInstanceGroupManagersApplyUpdatesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->applyUpdatesToInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..afe82c7eaa74 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/create_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersCreateInstancesRequestResource( + $regionInstanceGroupManagersCreateInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->createInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5e4a55c5f665 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete.php @@ -0,0 +1,85 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0547494d5bcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersDeleteInstancesRequestResource( + $regionInstanceGroupManagersDeleteInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->deleteInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c9cc4fabae9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerDeleteInstanceConfigReqResource( + $regionInstanceGroupManagerDeleteInstanceConfigReqResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->deletePerInstanceConfigs($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0c877e3cc547 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/get.php @@ -0,0 +1,76 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var InstanceGroupManager $response */ + $response = $regionInstanceGroupManagersClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6682e499d002 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/insert.php @@ -0,0 +1,85 @@ +setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8d0b5eb71c50 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceGroupManagersClient->list($request); + + 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..b78f8397ee60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_errors.php @@ -0,0 +1,79 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceGroupManagersClient->listErrors($request); + + 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..782f39bf95fa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php @@ -0,0 +1,82 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceGroupManagersClient->listManagedInstances($request); + + 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..36b1b9d2a68c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php @@ -0,0 +1,82 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceGroupManagersClient->listPerInstanceConfigs($request); + + 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..e0be94ef9223 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch.php @@ -0,0 +1,88 @@ +setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagerResource($instanceGroupManagerResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dcf43fce238d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerPatchInstanceConfigReqResource( + $regionInstanceGroupManagerPatchInstanceConfigReqResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->patchPerInstanceConfigs($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b3d825a45dcf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersRecreateRequestResource( + $regionInstanceGroupManagersRecreateRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->recreateInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..68a31f5ccba8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resize.php @@ -0,0 +1,92 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setSize($size); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->resize($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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/resume_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resume_instances.php new file mode 100644 index 000000000000..9e55a0a7c8d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/resume_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersResumeInstancesRequestResource( + $regionInstanceGroupManagersResumeInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->resumeInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + resume_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_ResumeInstances_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..2b00d4402bf3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTemplateRequestResource( + $regionInstanceGroupManagersSetTemplateRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->setInstanceTemplate($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..57d31dd00056 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSetTargetPoolsRequestResource( + $regionInstanceGroupManagersSetTargetPoolsRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->setTargetPools($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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/start_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/start_instances.php new file mode 100644 index 000000000000..8ec12fcb3b60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/start_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStartInstancesRequestResource( + $regionInstanceGroupManagersStartInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->startInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + start_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_StartInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php new file mode 100644 index 000000000000..8abe0fcd78b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/stop_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStopInstancesRequestResource( + $regionInstanceGroupManagersStopInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->stopInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + stop_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_StopInstances_sync] diff --git a/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php new file mode 100644 index 000000000000..2bdc949ec758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSuspendInstancesRequestResource( + $regionInstanceGroupManagersSuspendInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->suspendInstances($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; + $project = '[PROJECT]'; + $region = '[REGION]'; + + suspend_instances_sample($instanceGroupManager, $project, $region); +} +// [END compute_v1_generated_RegionInstanceGroupManagers_SuspendInstances_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..2c3ec4c36a9c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php @@ -0,0 +1,93 @@ +setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagerUpdateInstanceConfigReqResource( + $regionInstanceGroupManagerUpdateInstanceConfigReqResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupManagersClient->updatePerInstanceConfigs($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a5d55ec70b6e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/get.php @@ -0,0 +1,76 @@ +setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var InstanceGroup $response */ + $response = $regionInstanceGroupsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..087c3a05cfff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceGroupsClient->list($request); + + 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..f24ad34361e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/list_instances.php @@ -0,0 +1,84 @@ +setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsListInstancesRequestResource( + $regionInstanceGroupsListInstancesRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceGroupsClient->listInstances($request); + + 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..f6084540e367 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceGroupsClient/set_named_ports.php @@ -0,0 +1,90 @@ +setInstanceGroup($instanceGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupsSetNamedPortsRequestResource( + $regionInstanceGroupsSetNamedPortsRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceGroupsClient->setNamedPorts($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3e24d1c4104d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/delete.php @@ -0,0 +1,85 @@ +setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceTemplatesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..376d2f78bb51 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/get.php @@ -0,0 +1,76 @@ +setInstanceTemplate($instanceTemplate) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var InstanceTemplate $response */ + $response = $regionInstanceTemplatesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a26c7fd44426 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/insert.php @@ -0,0 +1,85 @@ +setInstanceTemplateResource($instanceTemplateResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstanceTemplatesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2d7f5c501281 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstanceTemplatesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstanceTemplatesClient->list($request); + + 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..39e794203af8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstancesClient/bulk_insert.php @@ -0,0 +1,85 @@ +setBulkInsertInstanceResourceResource($bulkInsertInstanceResourceResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstancesClient->bulkInsert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3df532007368 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/delete.php @@ -0,0 +1,85 @@ +setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstantSnapshotsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b77cf67f86ca --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get.php @@ -0,0 +1,76 @@ +setInstantSnapshot($instantSnapshot) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var InstantSnapshot $response */ + $response = $regionInstantSnapshotsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c8f1d378f79 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionInstantSnapshotsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..77a3069bbfb1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/insert.php @@ -0,0 +1,85 @@ +setInstantSnapshotResource($instantSnapshotResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstantSnapshotsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..18e6649d2bce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionInstantSnapshotsClient->list($request); + + 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..01f1bffa912e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionInstantSnapshotsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dd54f5792a0c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionInstantSnapshotsClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c79106699024 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $regionInstantSnapshotsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5b0b1bc15bd7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php @@ -0,0 +1,93 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsAttachEndpointsRequestResource( + $regionNetworkEndpointGroupsAttachEndpointsRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkEndpointGroupsClient->attachNetworkEndpoints($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0a689609f788 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/delete.php @@ -0,0 +1,85 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkEndpointGroupsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9173c836a20a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php @@ -0,0 +1,93 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region) + ->setRegionNetworkEndpointGroupsDetachEndpointsRequestResource( + $regionNetworkEndpointGroupsDetachEndpointsRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkEndpointGroupsClient->detachNetworkEndpoints($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c1d402651194 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/get.php @@ -0,0 +1,76 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var NetworkEndpointGroup $response */ + $response = $regionNetworkEndpointGroupsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bf96e294ecce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/insert.php @@ -0,0 +1,85 @@ +setNetworkEndpointGroupResource($networkEndpointGroupResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkEndpointGroupsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..36c05b2195b0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionNetworkEndpointGroupsClient->list($request); + + 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..e92a248ae9fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php @@ -0,0 +1,82 @@ +setNetworkEndpointGroup($networkEndpointGroup) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionNetworkEndpointGroupsClient->listNetworkEndpoints($request); + + 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..921e2b053c15 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php @@ -0,0 +1,88 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyAssociationResource($firewallPolicyAssociationResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->addAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c092072b9fa5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php @@ -0,0 +1,88 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->addRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..62380a3fb1e0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->cloneRules($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..69e2b660e0bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/delete.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..29da1fadfe7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get.php @@ -0,0 +1,76 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicy $response */ + $response = $regionNetworkFirewallPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..27d7af656e85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php @@ -0,0 +1,76 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicyAssociation $response */ + $response = $regionNetworkFirewallPoliciesClient->getAssociation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c3ca198bb63f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php @@ -0,0 +1,76 @@ +setNetwork($network) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->getEffectiveFirewalls($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..889feb3ce6b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionNetworkFirewallPoliciesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5ec3df2933dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php @@ -0,0 +1,76 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var FirewallPolicyRule $response */ + $response = $regionNetworkFirewallPoliciesClient->getRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9aa175091f0b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/insert.php @@ -0,0 +1,85 @@ +setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3ed374c9f1cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->list($request); + + 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..203ee61cbe54 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch.php @@ -0,0 +1,88 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyResource($firewallPolicyResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bd6e86fb0a9d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php @@ -0,0 +1,88 @@ +setFirewallPolicy($firewallPolicy) + ->setFirewallPolicyRuleResource($firewallPolicyRuleResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->patchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..71e2dd19e12e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->removeAssociation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c2ea9a8a450c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php @@ -0,0 +1,85 @@ +setFirewallPolicy($firewallPolicy) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->removeRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..91f55e6cb121 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $regionNetworkFirewallPoliciesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..208e1c1bc453 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $regionNetworkFirewallPoliciesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8cc70ad59028 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/delete.php @@ -0,0 +1,85 @@ +setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNotificationEndpointsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fbdd2c37998a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/get.php @@ -0,0 +1,76 @@ +setNotificationEndpoint($notificationEndpoint) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var NotificationEndpoint $response */ + $response = $regionNotificationEndpointsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cf26b16c1922 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/insert.php @@ -0,0 +1,85 @@ +setNotificationEndpointResource($notificationEndpointResource) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionNotificationEndpointsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7e5dd34d7376 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionNotificationEndpointsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionNotificationEndpointsClient->list($request); + + 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..355372d3632a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/delete.php @@ -0,0 +1,76 @@ +setOperation($operation) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var DeleteRegionOperationResponse $response */ + $response = $regionOperationsClient->delete($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..59ca0576724d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/get.php @@ -0,0 +1,76 @@ +setOperation($operation) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $regionOperationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e7a6d3749247 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionOperationsClient->list($request); + + 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..84df5e2436c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionOperationsClient/wait.php @@ -0,0 +1,76 @@ +setOperation($operation) + ->setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $regionOperationsClient->wait($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..73a729b41005 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/add_rule.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->addRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f62a52726105 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..12a9a95119e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var SecurityPolicy $response */ + $response = $regionSecurityPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..40a9fd77ebb5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/get_rule.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var SecurityPolicyRule $response */ + $response = $regionSecurityPoliciesClient->getRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..316c5952e9a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicyResource($securityPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3a1b5fe87047 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionSecurityPoliciesClient->list($request); + + 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..79905f7a4a2e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..067fc6893a78 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/patch_rule.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->patchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..91951595fca3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/remove_rule.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->removeRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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/RegionSecurityPoliciesClient/set_labels.php b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/set_labels.php new file mode 100644 index 000000000000..18376f8bc446 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSecurityPoliciesClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSecurityPoliciesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $project = '[PROJECT]'; + $region = '[REGION]'; + $resource = '[RESOURCE]'; + + set_labels_sample($project, $region, $resource); +} +// [END compute_v1_generated_RegionSecurityPolicies_SetLabels_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..ffc472b2f46a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSslCertificatesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..71a1fa1d944f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setSslCertificate($sslCertificate); + + // Call the API and handle any network failures. + try { + /** @var SslCertificate $response */ + $response = $regionSslCertificatesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ff269f294a5a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSslCertificateResource($sslCertificateResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSslCertificatesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..da864cf16d17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslCertificatesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionSslCertificatesClient->list($request); + + 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..bbd06e12aecd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSslPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6e658537b7c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy); + + // Call the API and handle any network failures. + try { + /** @var SslPolicy $response */ + $response = $regionSslPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e743ccb7fead --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSslPolicyResource($sslPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSslPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..591d8e7ded8d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionSslPoliciesClient->list($request); + + 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..df01c4ebf267 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/list_available_features.php @@ -0,0 +1,73 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var SslPoliciesListAvailableFeaturesResponse $response */ + $response = $regionSslPoliciesClient->listAvailableFeatures($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8aa11cbf48f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionSslPoliciesClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionSslPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aea1b13e3553 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..36f3e60d2049 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetHttpProxy $response */ + $response = $regionTargetHttpProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aeca4dcc6b7f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpProxyResource($targetHttpProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..795cbc43af36 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionTargetHttpProxiesClient->list($request); + + 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..0486a4b1f1b9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpProxiesClient/set_url_map.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpProxiesClient->setUrlMap($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e49527f55dff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpsProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..48bc56dda947 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetHttpsProxy $response */ + $response = $regionTargetHttpsProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aa0b9faf3e6f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpsProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6963b2ee5a39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionTargetHttpsProxiesClient->list($request); + + 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..772d902f9345 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpsProxiesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..aeceb9133811 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php @@ -0,0 +1,93 @@ +setProject($project) + ->setRegion($region) + ->setRegionTargetHttpsProxiesSetSslCertificatesRequestResource( + $regionTargetHttpsProxiesSetSslCertificatesRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpsProxiesClient->setSslCertificates($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8573c5cf7871 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetHttpsProxiesClient->setUrlMap($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1fce52a2d99b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetTcpProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b7f7adb3d7dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setTargetTcpProxy($targetTcpProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetTcpProxy $response */ + $response = $regionTargetTcpProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3079d8364e3e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetTcpProxyResource($targetTcpProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionTargetTcpProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2442e73e1c9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionTargetTcpProxiesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionTargetTcpProxiesClient->list($request); + + 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..9fa46952d521 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionUrlMapsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..80a1cb12a2d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap); + + // Call the API and handle any network failures. + try { + /** @var UrlMap $response */ + $response = $regionUrlMapsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8d73e9b4a280 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setUrlMapResource($urlMapResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionUrlMapsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..02ba03c12971 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionUrlMapsClient->list($request); + + 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..33aed33e330c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionUrlMapsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7ca90946d245 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/update.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $regionUrlMapsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0f2d75254fea --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionUrlMapsClient/validate.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionUrlMapsValidateRequestResource($regionUrlMapsValidateRequestResource) + ->setUrlMap($urlMap); + + // Call the API and handle any network failures. + try { + /** @var UrlMapsValidateResponse $response */ + $response = $regionUrlMapsClient->validate($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b17d27970a6a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionZonesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionZonesClient->list($request); + + 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..6fd168420208 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var Region $response */ + $response = $regionsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4658e561ab06 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RegionsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $regionsClient->list($request); + + 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..1a875783b73b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationsClient->aggregatedList($request); + + 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..41d2800307ff --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setReservation($reservation) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $reservationsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c16dc54a291 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setReservation($reservation) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Reservation $response */ + $response = $reservationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..73448e27fbe8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $reservationsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..92a0cfe2988f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setReservationResource($reservationResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $reservationsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fee19f604151 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $reservationsClient->list($request); + + 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..ba885a55b77a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/resize.php @@ -0,0 +1,88 @@ +setProject($project) + ->setReservation($reservation) + ->setReservationsResizeRequestResource($reservationsResizeRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $reservationsClient->resize($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f9ec28551047 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $reservationsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..bd6d34501616 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $reservationsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..72553bb43a4c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ReservationsClient/update.php @@ -0,0 +1,88 @@ +setProject($project) + ->setReservation($reservation) + ->setReservationResource($reservationResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $reservationsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e655e915f1cf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $resourcePoliciesClient->aggregatedList($request); + + 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..3ecd8bae01f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $resourcePoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f0c9b88b7fcc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy); + + // Call the API and handle any network failures. + try { + /** @var ResourcePolicy $response */ + $response = $resourcePoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dde121e4c902 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $resourcePoliciesClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1e2a426ac7f1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setResourcePolicyResource($resourcePolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $resourcePoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2d970e78dc86 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $resourcePoliciesClient->list($request); + + 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..34a8e8cd4c02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setResourcePolicy($resourcePolicy) + ->setResourcePolicyResource($resourcePolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $resourcePoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9e8f22097f9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $resourcePoliciesClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..70e51d275d2a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ResourcePoliciesClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $resourcePoliciesClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f06ac24e8dcf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $routersClient->aggregatedList($request); + + 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..e6968b826fed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routersClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4864bf17e751 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var Router $response */ + $response = $routersClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f0f3fa163265 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_ip_info.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var NatIpInfoResponse $response */ + $response = $routersClient->getNatIpInfo($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9878586bf335 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_nat_mapping_info.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $routersClient->getNatMappingInfo($request); + + 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..86cb7dba2f59 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/get_router_status.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router); + + // Call the API and handle any network failures. + try { + /** @var RouterStatusResponse $response */ + $response = $routersClient->getRouterStatus($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7e75f640f9d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setRouterResource($routerResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routersClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..622d0554c5d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $routersClient->list($request); + + 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..9f95ba587418 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routersClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6fc8308af2ba --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/preview.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + + // Call the API and handle any network failures. + try { + /** @var RoutersPreviewResponse $response */ + $response = $routersClient->preview($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..41ef5484616c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutersClient/update.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRouter($router) + ->setRouterResource($routerResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routersClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3085c2f8617e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setRoute($route); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0e79b0baf072 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setRoute($route); + + // Call the API and handle any network failures. + try { + /** @var Route $response */ + $response = $routesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b5c5c5fd28e5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setRouteResource($routeResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $routesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9c859976a2d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/RoutesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $routesClient->list($request); + + 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..9e4eb6d400aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/add_rule.php @@ -0,0 +1,85 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->addRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..34337e5d4071 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $securityPoliciesClient->aggregatedList($request); + + 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..071c570f4bfa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..57405461e229 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var SecurityPolicy $response */ + $response = $securityPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..afd902759b92 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/get_rule.php @@ -0,0 +1,73 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var SecurityPolicyRule $response */ + $response = $securityPoliciesClient->getRule($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..09115bc3dfbb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSecurityPolicyResource($securityPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b300ee62a316 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $securityPoliciesClient->list($request); + + 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..2de488fdb9b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php @@ -0,0 +1,70 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var SecurityPoliciesListPreconfiguredExpressionSetsResponse $response */ + $response = $securityPoliciesClient->listPreconfiguredExpressionSets($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..68e358056517 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyResource($securityPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..358549904650 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/patch_rule.php @@ -0,0 +1,85 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy) + ->setSecurityPolicyRuleResource($securityPolicyRuleResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->patchRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e8c116713d6d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/remove_rule.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSecurityPolicy($securityPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->removeRule($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..22a85dc57c58 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SecurityPoliciesClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $securityPoliciesClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..587dc46b6073 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $serviceAttachmentsClient->aggregatedList($request); + + 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..7444068bd1b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $serviceAttachmentsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..328a1a1665bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment); + + // Call the API and handle any network failures. + try { + /** @var ServiceAttachment $response */ + $response = $serviceAttachmentsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..20f411dd999c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $serviceAttachmentsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..147a7df5ef81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setServiceAttachmentResource($serviceAttachmentResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $serviceAttachmentsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..dc5af3924779 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $serviceAttachmentsClient->list($request); + + 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..cfadf87f74f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setServiceAttachment($serviceAttachment) + ->setServiceAttachmentResource($serviceAttachmentResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $serviceAttachmentsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..788cc13175f4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $serviceAttachmentsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7bbae3ee0d21 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ServiceAttachmentsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $serviceAttachmentsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c60d8e071eaa --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/get.php @@ -0,0 +1,70 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var SnapshotSettings $response */ + $response = $snapshotSettingsServiceClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..04a86d6090c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotSettingsServiceClient/patch.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSnapshotSettingsResource($snapshotSettingsResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $snapshotSettingsServiceClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4ba913f26b39 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSnapshot($snapshot); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $snapshotsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8bffec34fcac --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setSnapshot($snapshot); + + // Call the API and handle any network failures. + try { + /** @var Snapshot $response */ + $response = $snapshotsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9aa4c8f97812 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/get_iam_policy.php @@ -0,0 +1,73 @@ +setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $snapshotsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9fb94600ba3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSnapshotResource($snapshotResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $snapshotsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b8037da41be3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $snapshotsClient->list($request); + + 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..29097fe592eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_iam_policy.php @@ -0,0 +1,76 @@ +setGlobalSetPolicyRequestResource($globalSetPolicyRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $snapshotsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b31e8101d8a3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/set_labels.php @@ -0,0 +1,85 @@ +setGlobalSetLabelsRequestResource($globalSetLabelsRequestResource) + ->setProject($project) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $snapshotsClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..79b23be9486f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SnapshotsClient/test_iam_permissions.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $snapshotsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..83c73ee96d84 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sslCertificatesClient->aggregatedList($request); + + 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..b14028350758 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSslCertificate($sslCertificate); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sslCertificatesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..f5ab5b814d35 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setSslCertificate($sslCertificate); + + // Call the API and handle any network failures. + try { + /** @var SslCertificate $response */ + $response = $sslCertificatesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d9c918e8a913 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSslCertificateResource($sslCertificateResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sslCertificatesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..32966ba98bd2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslCertificatesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sslCertificatesClient->list($request); + + 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..1f6421db65b7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sslPoliciesClient->aggregatedList($request); + + 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..447d15c8a715 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSslPolicy($sslPolicy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sslPoliciesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b300770cc0dc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setSslPolicy($sslPolicy); + + // Call the API and handle any network failures. + try { + /** @var SslPolicy $response */ + $response = $sslPoliciesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..df8a92b764c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setSslPolicyResource($sslPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sslPoliciesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..113a5334abca --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $sslPoliciesClient->list($request); + + 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..92581b04b2d3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/list_available_features.php @@ -0,0 +1,70 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var SslPoliciesListAvailableFeaturesResponse $response */ + $response = $sslPoliciesClient->listAvailableFeatures($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..60cfebb729d1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SslPoliciesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setSslPolicy($sslPolicy) + ->setSslPolicyResource($sslPolicyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $sslPoliciesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..14cae8ef8214 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $storagePoolTypesClient->aggregatedList($request); + + 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..35793f1c3eae --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setStoragePoolType($storagePoolType) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var StoragePoolType $response */ + $response = $storagePoolTypesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2a67ea8fd3eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolTypesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $storagePoolTypesClient->list($request); + + 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..1e328a002d7c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $storagePoolsClient->aggregatedList($request); + + 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..9824c0188fdf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $storagePoolsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..92c7649b0c66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var StoragePool $response */ + $response = $storagePoolsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..24e955e17907 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $storagePoolsClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4abac2d3ee55 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $storagePoolsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8ab74020905d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list.php @@ -0,0 +1,73 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var StoragePoolList $response */ + $response = $storagePoolsClient->list($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8f6df4716b45 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/list_disks.php @@ -0,0 +1,76 @@ +setProject($project) + ->setStoragePool($storagePool) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var StoragePoolListDisks $response */ + $response = $storagePoolsClient->listDisks($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d20fd01386f8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setZone($zone) + ->setZoneSetPolicyRequestResource($zoneSetPolicyRequestResource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $storagePoolsClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3bb8781a8c1e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $storagePoolsClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..36815576acab --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/StoragePoolsClient/update.php @@ -0,0 +1,88 @@ +setProject($project) + ->setStoragePool($storagePool) + ->setStoragePoolResource($storagePoolResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $storagePoolsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..32d9dae73cc3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $subnetworksClient->aggregatedList($request); + + 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..1e385b3ae242 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $subnetworksClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9ae19662e2a1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/expand_ip_cidr_range.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksExpandIpCidrRangeRequestResource($subnetworksExpandIpCidrRangeRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $subnetworksClient->expandIpCidrRange($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..093cb6501100 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork); + + // Call the API and handle any network failures. + try { + /** @var Subnetwork $response */ + $response = $subnetworksClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8bc32115e666 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/get_iam_policy.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $subnetworksClient->getIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0a495eff6242 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setSubnetworkResource($subnetworkResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $subnetworksClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..46e10f76a1a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $subnetworksClient->list($request); + + 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..aee9cd25e380 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/list_usable.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $subnetworksClient->listUsable($request); + + 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..a298498d56b5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/patch.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworkResource($subnetworkResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $subnetworksClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ddc2f7c7cd19 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_iam_policy.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetPolicyRequestResource($regionSetPolicyRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var Policy $response */ + $response = $subnetworksClient->setIamPolicy($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..26c4cd9a2153 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/set_private_ip_google_access.php @@ -0,0 +1,93 @@ +setProject($project) + ->setRegion($region) + ->setSubnetwork($subnetwork) + ->setSubnetworksSetPrivateIpGoogleAccessRequestResource( + $subnetworksSetPrivateIpGoogleAccessRequestResource + ); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $subnetworksClient->setPrivateIpGoogleAccess($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..faae6d433a17 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/SubnetworksClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $subnetworksClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9cb22b62d6ee --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetGrpcProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..12f6e7eae027 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetGrpcProxy $response */ + $response = $targetGrpcProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8b8b2b26b86b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetGrpcProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6be8920c8bd1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetGrpcProxiesClient->list($request); + + 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..df9a6586b501 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetGrpcProxiesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetGrpcProxy($targetGrpcProxy) + ->setTargetGrpcProxyResource($targetGrpcProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetGrpcProxiesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..743bc3ed7934 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetHttpProxiesClient->aggregatedList($request); + + 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..6173df6b541c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..19bdb380552d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setTargetHttpProxy($targetHttpProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetHttpProxy $response */ + $response = $targetHttpProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..51722050e468 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetHttpProxyResource($targetHttpProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6c448479868a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetHttpProxiesClient->list($request); + + 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..f67dfe278e1c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setTargetHttpProxyResource($targetHttpProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpProxiesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..08dacff690fd --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpProxiesClient/set_url_map.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetHttpProxy($targetHttpProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpProxiesClient->setUrlMap($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a1912ca0fd5c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetHttpsProxiesClient->aggregatedList($request); + + 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..76365fc7f1a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..409c176e704e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetHttpsProxy $response */ + $response = $targetHttpsProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b3a622d5c937 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d9214c3eb80c --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetHttpsProxiesClient->list($request); + + 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..b9b2a7e0e278 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setTargetHttpsProxyResource($targetHttpsProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..47ee78d9e913 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_certificate_map.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetHttpsProxiesSetCertificateMapRequestResource( + $targetHttpsProxiesSetCertificateMapRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->setCertificateMap($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fa288ce0df34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_quic_override.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetHttpsProxiesSetQuicOverrideRequestResource( + $targetHttpsProxiesSetQuicOverrideRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->setQuicOverride($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..61d440e97903 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetHttpsProxiesSetSslCertificatesRequestResource( + $targetHttpsProxiesSetSslCertificatesRequestResource + ) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->setSslCertificates($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..cb629c7b7bdc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php @@ -0,0 +1,85 @@ +setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetHttpsProxy($targetHttpsProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->setSslPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..60b0629b0590 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetHttpsProxiesClient/set_url_map.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetHttpsProxy($targetHttpsProxy) + ->setUrlMapReferenceResource($urlMapReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetHttpsProxiesClient->setUrlMap($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4cd292e4c147 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetInstancesClient->aggregatedList($request); + + 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..1c4524b0e9e2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetInstancesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7a12582eb617 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setTargetInstance($targetInstance) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var TargetInstance $response */ + $response = $targetInstancesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7ee713d8c3bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetInstanceResource($targetInstanceResource) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetInstancesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..13c677d6fddc --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetInstancesClient->list($request); + + 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..b4a7f30ece82 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetInstancesClient/set_security_policy.php @@ -0,0 +1,88 @@ +setProject($project) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetInstance($targetInstance) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetInstancesClient->setSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..02c9fc63c064 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_health_check.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddHealthCheckRequestResource($targetPoolsAddHealthCheckRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->addHealthCheck($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8622cd615a1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/add_instance.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsAddInstanceRequestResource($targetPoolsAddInstanceRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->addInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..11fc95df8012 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetPoolsClient->aggregatedList($request); + + 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..73ebd5f5729e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..acfb91b7d5b2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + + // Call the API and handle any network failures. + try { + /** @var TargetPool $response */ + $response = $targetPoolsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c0a4bb2ec176 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/get_health.php @@ -0,0 +1,79 @@ +setInstanceReferenceResource($instanceReferenceResource) + ->setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool); + + // Call the API and handle any network failures. + try { + /** @var TargetPoolInstanceHealth $response */ + $response = $targetPoolsClient->getHealth($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fd3e245b6bf6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetPoolResource($targetPoolResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6ce2bd1fd4c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetPoolsClient->list($request); + + 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..c3ed4c375784 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_health_check.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveHealthCheckRequestResource($targetPoolsRemoveHealthCheckRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->removeHealthCheck($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..5645b24b1854 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/remove_instance.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetPoolsRemoveInstanceRequestResource($targetPoolsRemoveInstanceRequestResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->removeInstance($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..4b40dc342c16 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_backup.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setTargetPool($targetPool) + ->setTargetReferenceResource($targetReferenceResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->setBackup($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..9563da1f3e1d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetPoolsClient/set_security_policy.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setSecurityPolicyReferenceResource($securityPolicyReferenceResource) + ->setTargetPool($targetPool); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetPoolsClient->setSecurityPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..58bbae68a7ed --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..c68fa0896f25 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetSslProxy $response */ + $response = $targetSslProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..48c35910eb1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetSslProxyResource($targetSslProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8e7e07debc9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetSslProxiesClient->list($request); + + 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..b277bb2a9c46 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_backend_service.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetSslProxiesSetBackendServiceRequestResource( + $targetSslProxiesSetBackendServiceRequestResource + ) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->setBackendService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..0e9bcc93d9de --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_certificate_map.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetSslProxiesSetCertificateMapRequestResource( + $targetSslProxiesSetCertificateMapRequestResource + ) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->setCertificateMap($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..556659f0f485 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_proxy_header.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetSslProxiesSetProxyHeaderRequestResource($targetSslProxiesSetProxyHeaderRequestResource) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->setProxyHeader($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..83a4868568c2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_certificates.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetSslProxiesSetSslCertificatesRequestResource( + $targetSslProxiesSetSslCertificatesRequestResource + ) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->setSslCertificates($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ebc6263380e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetSslProxiesClient/set_ssl_policy.php @@ -0,0 +1,85 @@ +setProject($project) + ->setSslPolicyReferenceResource($sslPolicyReferenceResource) + ->setTargetSslProxy($targetSslProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetSslProxiesClient->setSslPolicy($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..7c28e201b881 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetTcpProxiesClient->aggregatedList($request); + + 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..5381f291c7af --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetTcpProxiesClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3ffc7178784b --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setTargetTcpProxy($targetTcpProxy); + + // Call the API and handle any network failures. + try { + /** @var TargetTcpProxy $response */ + $response = $targetTcpProxiesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..860b514e68f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setTargetTcpProxyResource($targetTcpProxyResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetTcpProxiesClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..59326503d39e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetTcpProxiesClient->list($request); + + 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..23951da44737 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_backend_service.php @@ -0,0 +1,87 @@ +setProject($project) + ->setTargetTcpProxiesSetBackendServiceRequestResource( + $targetTcpProxiesSetBackendServiceRequestResource + ) + ->setTargetTcpProxy($targetTcpProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetTcpProxiesClient->setBackendService($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e72cf4bbd3de --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetTcpProxiesClient/set_proxy_header.php @@ -0,0 +1,85 @@ +setProject($project) + ->setTargetTcpProxiesSetProxyHeaderRequestResource($targetTcpProxiesSetProxyHeaderRequestResource) + ->setTargetTcpProxy($targetTcpProxy); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetTcpProxiesClient->setProxyHeader($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..373e69f99b59 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetVpnGatewaysClient->aggregatedList($request); + + 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..b689e43c3b5f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetVpnGatewaysClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..fd00dd6202f0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setTargetVpnGateway($targetVpnGateway); + + // Call the API and handle any network failures. + try { + /** @var TargetVpnGateway $response */ + $response = $targetVpnGatewaysClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..3e4a146947f5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setTargetVpnGatewayResource($targetVpnGatewayResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetVpnGatewaysClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..af73a2cdd1b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $targetVpnGatewaysClient->list($request); + + 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..0c395a0ed3d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/TargetVpnGatewaysClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $targetVpnGatewaysClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..ac09b463c85f --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $urlMapsClient->aggregatedList($request); + + 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..3c56f7ba87a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/delete.php @@ -0,0 +1,82 @@ +setProject($project) + ->setUrlMap($urlMap); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $urlMapsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..6929e4f7f228 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setUrlMap($urlMap); + + // Call the API and handle any network failures. + try { + /** @var UrlMap $response */ + $response = $urlMapsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..15da213a32a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/insert.php @@ -0,0 +1,82 @@ +setProject($project) + ->setUrlMapResource($urlMapResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $urlMapsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..812d9c8c97c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/invalidate_cache.php @@ -0,0 +1,85 @@ +setCacheInvalidationRuleResource($cacheInvalidationRuleResource) + ->setProject($project) + ->setUrlMap($urlMap); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $urlMapsClient->invalidateCache($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..34f39920bfde --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $urlMapsClient->list($request); + + 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..047057a2b81e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/patch.php @@ -0,0 +1,85 @@ +setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $urlMapsClient->patch($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a0a1695ed15d --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/update.php @@ -0,0 +1,85 @@ +setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapResource($urlMapResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $urlMapsClient->update($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..b5ff41f47ce8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/UrlMapsClient/validate.php @@ -0,0 +1,76 @@ +setProject($project) + ->setUrlMap($urlMap) + ->setUrlMapsValidateRequestResource($urlMapsValidateRequestResource); + + // Call the API and handle any network failures. + try { + /** @var UrlMapsValidateResponse $response */ + $response = $urlMapsClient->validate($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..8d12ea3fe81a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vpnGatewaysClient->aggregatedList($request); + + 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..b3257c88624e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vpnGatewaysClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d26823bf4a9a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + + // Call the API and handle any network failures. + try { + /** @var VpnGateway $response */ + $response = $vpnGatewaysClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..e67fec20896a --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/get_status.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setVpnGateway($vpnGateway); + + // Call the API and handle any network failures. + try { + /** @var VpnGatewaysGetStatusResponse $response */ + $response = $vpnGatewaysClient->getStatus($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..1461c1f6fde6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setVpnGatewayResource($vpnGatewayResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vpnGatewaysClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..2b2534b46390 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vpnGatewaysClient->list($request); + + 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..8c83f75af709 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vpnGatewaysClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d301d490d1da --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnGatewaysClient/test_iam_permissions.php @@ -0,0 +1,79 @@ +setProject($project) + ->setRegion($region) + ->setResource($resource) + ->setTestPermissionsRequestResource($testPermissionsRequestResource); + + // Call the API and handle any network failures. + try { + /** @var TestPermissionsResponse $response */ + $response = $vpnGatewaysClient->testIamPermissions($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..49d301ed62b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/aggregated_list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vpnTunnelsClient->aggregatedList($request); + + 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..322a595f0368 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/delete.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vpnTunnelsClient->delete($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..a91cb8444081 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/get.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region) + ->setVpnTunnel($vpnTunnel); + + // Call the API and handle any network failures. + try { + /** @var VpnTunnel $response */ + $response = $vpnTunnelsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..16ab5c539321 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/insert.php @@ -0,0 +1,85 @@ +setProject($project) + ->setRegion($region) + ->setVpnTunnelResource($vpnTunnelResource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vpnTunnelsClient->insert($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..47d06e620db9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setRegion($region); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vpnTunnelsClient->list($request); + + 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..08748c0381ce --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/VpnTunnelsClient/set_labels.php @@ -0,0 +1,88 @@ +setProject($project) + ->setRegion($region) + ->setRegionSetLabelsRequestResource($regionSetLabelsRequestResource) + ->setResource($resource); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vpnTunnelsClient->setLabels($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..442a588b68c8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/delete.php @@ -0,0 +1,76 @@ +setOperation($operation) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var DeleteZoneOperationResponse $response */ + $response = $zoneOperationsClient->delete($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..717040ecf5b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/get.php @@ -0,0 +1,76 @@ +setOperation($operation) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $zoneOperationsClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d8901eb81abe --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/list.php @@ -0,0 +1,76 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $zoneOperationsClient->list($request); + + 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..ab4868d712d8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZoneOperationsClient/wait.php @@ -0,0 +1,76 @@ +setOperation($operation) + ->setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Operation $response */ + $response = $zoneOperationsClient->wait($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..72cea5199caf --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/get.php @@ -0,0 +1,73 @@ +setProject($project) + ->setZone($zone); + + // Call the API and handle any network failures. + try { + /** @var Zone $response */ + $response = $zonesClient->get($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $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..d5d7541d409e --- /dev/null +++ b/owl-bot-staging/Compute/V1/samples/V1/ZonesClient/list.php @@ -0,0 +1,73 @@ +setProject($project); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $zonesClient->list($request); + + 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 @@ + aggregatedListAsync(AggregatedListAcceleratorTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetAcceleratorTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListAcceleratorTypesRequest $request, array $optionalArgs = []) + */ +final class AcceleratorTypesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.AcceleratorTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/AcceleratorTypesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/AcceleratorTypesClient/get.php + * + * @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()} . + * + * @example samples/V1/AcceleratorTypesClient/list.php + * + * @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..ae4978280590 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/AddressesClient.php @@ -0,0 +1,431 @@ + aggregatedListAsync(AggregatedListAddressesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface
getAsync(GetAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListAddressesRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveAsync(MoveAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsAddressRequest $request, array $optionalArgs = []) + */ +final class AddressesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Addresses'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/AddressesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/AddressesClient/delete.php + * + * @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()} . + * + * @example samples/V1/AddressesClient/get.php + * + * @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()} . + * + * @example samples/V1/AddressesClient/insert.php + * + * @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()} . + * + * @example samples/V1/AddressesClient/list.php + * + * @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()} . + * + * @example samples/V1/AddressesClient/move.php + * + * @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()} . + * + * @example samples/V1/AddressesClient/set_labels.php + * + * @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..4d008d0e838a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/AutoscalersClient.php @@ -0,0 +1,431 @@ + aggregatedListAsync(AggregatedListAutoscalersRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListAutoscalersRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateAutoscalerRequest $request, array $optionalArgs = []) + */ +final class AutoscalersClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Autoscalers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/delete.php + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/get.php + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/insert.php + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/list.php + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/patch.php + * + * @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()} . + * + * @example samples/V1/AutoscalersClient/update.php + * + * @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..8631800ab30b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/BackendBucketsClient.php @@ -0,0 +1,572 @@ + addSignedUrlKeyAsync(AddSignedUrlKeyBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListBackendBucketsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface setEdgeSecurityPolicyAsync(SetEdgeSecurityPolicyBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsBackendBucketRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateBackendBucketRequest $request, array $optionalArgs = []) + */ +final class BackendBucketsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.BackendBuckets'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/add_signed_url_key.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/delete.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/delete_signed_url_key.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/get.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/insert.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/list.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/patch.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/set_edge_security_policy.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/BackendBucketsClient/update.php + * + * @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..12a7ff79e236 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/BackendServicesClient.php @@ -0,0 +1,686 @@ + addSignedUrlKeyAsync(AddSignedUrlKeyBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListBackendServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteSignedUrlKeyAsync(DeleteSignedUrlKeyBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getHealthAsync(GetHealthBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListBackendServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listUsableAsync(ListUsableBackendServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setEdgeSecurityPolicyAsync(SetEdgeSecurityPolicyBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSecurityPolicyAsync(SetSecurityPolicyBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateBackendServiceRequest $request, array $optionalArgs = []) + */ +final class BackendServicesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.BackendServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/add_signed_url_key.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/delete.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/delete_signed_url_key.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/get.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/get_health.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/insert.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/list.php + * + * @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 a list of all usable backend services in the specified project. + * + * The async variant is {@see BackendServicesClient::listUsableAsync()} . + * + * @example samples/V1/BackendServicesClient/list_usable.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/patch.php + * + * @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()} + * . + * + * @example samples/V1/BackendServicesClient/set_edge_security_policy.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/set_security_policy.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/BackendServicesClient/update.php + * + * @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..c65aada338b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/DiskTypesClient.php @@ -0,0 +1,263 @@ + aggregatedListAsync(AggregatedListDiskTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetDiskTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListDiskTypesRequest $request, array $optionalArgs = []) + */ +final class DiskTypesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.DiskTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/DiskTypesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/DiskTypesClient/get.php + * + * @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()} . + * + * @example samples/V1/DiskTypesClient/list.php + * + * @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..391e29b652aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/DisksClient.php @@ -0,0 +1,741 @@ + addResourcePoliciesAsync(AddResourcePoliciesDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListDisksRequest $request, array $optionalArgs = []) + * @method PromiseInterface bulkInsertAsync(BulkInsertDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSnapshotAsync(CreateSnapshotDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListDisksRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeResourcePoliciesAsync(RemoveResourcePoliciesDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface resizeAsync(ResizeDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface startAsyncReplicationAsync(StartAsyncReplicationDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopAsyncReplicationAsync(StopAsyncReplicationDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopGroupAsyncReplicationAsync(StopGroupAsyncReplicationDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateDiskRequest $request, array $optionalArgs = []) + */ +final class DisksClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Disks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/DisksClient/add_resource_policies.php + * + * @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()} . + * + * @example samples/V1/DisksClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/DisksClient/bulk_insert.php + * + * @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()} . + * + * @example samples/V1/DisksClient/create_snapshot.php + * + * @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()} . + * + * @example samples/V1/DisksClient/delete.php + * + * @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()} . + * + * @example samples/V1/DisksClient/get.php + * + * @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()} . + * + * @example samples/V1/DisksClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/DisksClient/insert.php + * + * @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()} . + * + * @example samples/V1/DisksClient/list.php + * + * @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()} . + * + * @example samples/V1/DisksClient/remove_resource_policies.php + * + * @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()} . + * + * @example samples/V1/DisksClient/resize.php + * + * @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()} . + * + * @example samples/V1/DisksClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/DisksClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/DisksClient/start_async_replication.php + * + * @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()} . + * + * @example samples/V1/DisksClient/stop_async_replication.php + * + * @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()} . + * + * @example samples/V1/DisksClient/stop_group_async_replication.php + * + * @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()} . + * + * @example samples/V1/DisksClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/DisksClient/update.php + * + * @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..df0be72ac6e7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ExternalVpnGatewaysClient.php @@ -0,0 +1,404 @@ + deleteAsync(DeleteExternalVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetExternalVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertExternalVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListExternalVpnGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsExternalVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsExternalVpnGatewayRequest $request, array $optionalArgs = []) + */ +final class ExternalVpnGatewaysClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.ExternalVpnGateways'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ExternalVpnGatewaysClient/delete.php + * + * @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()} . + * + * @example samples/V1/ExternalVpnGatewaysClient/get.php + * + * @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()} . + * + * @example samples/V1/ExternalVpnGatewaysClient/insert.php + * + * @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()} . + * + * @example samples/V1/ExternalVpnGatewaysClient/list.php + * + * @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()} . + * + * @example samples/V1/ExternalVpnGatewaysClient/set_labels.php + * + * @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()} + * . + * + * @example samples/V1/ExternalVpnGatewaysClient/test_iam_permissions.php + * + * @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..037586fd6101 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/FirewallPoliciesClient.php @@ -0,0 +1,742 @@ + addAssociationAsync(AddAssociationFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface addRuleAsync(AddRuleFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface cloneRulesAsync(CloneRulesFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAssociationAsync(GetAssociationFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRuleAsync(GetRuleFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListFirewallPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAssociationsAsync(ListAssociationsFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveAsync(MoveFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchRuleAsync(PatchRuleFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeAssociationAsync(RemoveAssociationFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeRuleAsync(RemoveRuleFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsFirewallPolicyRequest $request, array $optionalArgs = []) + */ +final class FirewallPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.FirewallPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/add_association.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/add_rule.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/clone_rules.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/get_association.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/get_rule.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/list_associations.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/move.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/patch.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/patch_rule.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/remove_association.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/remove_rule.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/FirewallPoliciesClient/test_iam_permissions.php + * + * @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..7e39c5fd24e6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/FirewallsClient.php @@ -0,0 +1,402 @@ + deleteAsync(DeleteFirewallRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetFirewallRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertFirewallRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListFirewallsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchFirewallRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateFirewallRequest $request, array $optionalArgs = []) + */ +final class FirewallsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Firewalls'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/FirewallsClient/delete.php + * + * @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()} . + * + * @example samples/V1/FirewallsClient/get.php + * + * @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()} . + * + * @example samples/V1/FirewallsClient/insert.php + * + * @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()} . + * + * @example samples/V1/FirewallsClient/list.php + * + * @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()} . + * + * @example samples/V1/FirewallsClient/patch.php + * + * @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()} . + * + * @example samples/V1/FirewallsClient/update.php + * + * @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..c1beaaf2f317 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ForwardingRulesClient.php @@ -0,0 +1,459 @@ + aggregatedListAsync(AggregatedListForwardingRulesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListForwardingRulesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface setTargetAsync(SetTargetForwardingRuleRequest $request, array $optionalArgs = []) + */ +final class ForwardingRulesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.ForwardingRules'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/delete.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/get.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/insert.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/list.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/patch.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/ForwardingRulesClient/set_target.php + * + * @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..845e35019302 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalAddressesClient.php @@ -0,0 +1,402 @@ + deleteAsync(DeleteGlobalAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface
getAsync(GetGlobalAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertGlobalAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListGlobalAddressesRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveAsync(MoveGlobalAddressRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsGlobalAddressRequest $request, array $optionalArgs = []) + */ +final class GlobalAddressesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.GlobalAddresses'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/GlobalAddressesClient/delete.php + * + * @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()} . + * + * @example samples/V1/GlobalAddressesClient/get.php + * + * @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()} . + * + * @example samples/V1/GlobalAddressesClient/insert.php + * + * @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()} . + * + * @example samples/V1/GlobalAddressesClient/list.php + * + * @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()} . + * + * @example samples/V1/GlobalAddressesClient/move.php + * + * @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()} . + * + * @example samples/V1/GlobalAddressesClient/set_labels.php + * + * @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..db6eb5e80da3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalForwardingRulesClient.php @@ -0,0 +1,430 @@ + deleteAsync(DeleteGlobalForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetGlobalForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertGlobalForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListGlobalForwardingRulesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchGlobalForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsGlobalForwardingRuleRequest $request, array $optionalArgs = []) + * @method PromiseInterface setTargetAsync(SetTargetGlobalForwardingRuleRequest $request, array $optionalArgs = []) + */ +final class GlobalForwardingRulesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.GlobalForwardingRules'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/delete.php + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/get.php + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/insert.php + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/list.php + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/patch.php + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/GlobalForwardingRulesClient/set_target.php + * + * @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..c808c8dfea8f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalNetworkEndpointGroupsClient.php @@ -0,0 +1,433 @@ + attachNetworkEndpointsAsync(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteGlobalNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface detachNetworkEndpointsAsync(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetGlobalNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertGlobalNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListGlobalNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNetworkEndpointsAsync(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + */ +final class GlobalNetworkEndpointGroupsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.GlobalNetworkEndpointGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/attach_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/delete.php + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/detach_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/get.php + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/insert.php + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/list.php + * + * @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()} . + * + * @example samples/V1/GlobalNetworkEndpointGroupsClient/list_network_endpoints.php + * + * @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..036ba721d821 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOperationsClient.php @@ -0,0 +1,319 @@ + aggregatedListAsync(AggregatedListGlobalOperationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteGlobalOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetGlobalOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListGlobalOperationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface waitAsync(WaitGlobalOperationRequest $request, array $optionalArgs = []) + */ +final class GlobalOperationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.GlobalOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/GlobalOperationsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/GlobalOperationsClient/delete.php + * + * @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()} . + * + * @example samples/V1/GlobalOperationsClient/get.php + * + * @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()} . + * + * @example samples/V1/GlobalOperationsClient/list.php + * + * @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()} . + * + * @example samples/V1/GlobalOperationsClient/wait.php + * + * @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..7fba4a561c23 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalOrganizationOperationsClient.php @@ -0,0 +1,263 @@ + deleteAsync(DeleteGlobalOrganizationOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetGlobalOrganizationOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListGlobalOrganizationOperationsRequest $request, array $optionalArgs = []) + */ +final class GlobalOrganizationOperationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.GlobalOrganizationOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/GlobalOrganizationOperationsClient/delete.php + * + * @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()} . + * + * @example samples/V1/GlobalOrganizationOperationsClient/get.php + * + * @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()} . + * + * @example samples/V1/GlobalOrganizationOperationsClient/list.php + * + * @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..ce7aeed278f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/GlobalPublicDelegatedPrefixesClient.php @@ -0,0 +1,374 @@ + deleteAsync(DeleteGlobalPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetGlobalPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertGlobalPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListGlobalPublicDelegatedPrefixesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchGlobalPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + */ +final class GlobalPublicDelegatedPrefixesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.GlobalPublicDelegatedPrefixes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/delete.php + * + * @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()} . + * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/get.php + * + * @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()} . + * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/insert.php + * + * @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()} . + * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/list.php + * + * @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()} . + * + * @example samples/V1/GlobalPublicDelegatedPrefixesClient/patch.php + * + * @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..4bae25bfba38 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/HealthChecksClient.php @@ -0,0 +1,430 @@ + aggregatedListAsync(AggregatedListHealthChecksRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListHealthChecksRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateHealthCheckRequest $request, array $optionalArgs = []) + */ +final class HealthChecksClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.HealthChecks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/delete.php + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/get.php + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/insert.php + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/list.php + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/patch.php + * + * @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()} . + * + * @example samples/V1/HealthChecksClient/update.php + * + * @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..24f7109111af --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ImageFamilyViewsClient.php @@ -0,0 +1,206 @@ + getAsync(GetImageFamilyViewRequest $request, array $optionalArgs = []) + */ +final class ImageFamilyViewsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.ImageFamilyViews'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ImageFamilyViewsClient/get.php + * + * @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..06c7375bd3fa --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ImagesClient.php @@ -0,0 +1,544 @@ + deleteAsync(DeleteImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface deprecateAsync(DeprecateImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface getFromFamilyAsync(GetFromFamilyImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListImagesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsImageRequest $request, array $optionalArgs = []) + */ +final class ImagesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Images'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ImagesClient/delete.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/deprecate.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/get.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/get_from_family.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/insert.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/list.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/patch.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/ImagesClient/test_iam_permissions.php + * + * @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..06063c007e26 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagerResizeRequestsClient.php @@ -0,0 +1,380 @@ + cancelAsync(CancelInstanceGroupManagerResizeRequestRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInstanceGroupManagerResizeRequestRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInstanceGroupManagerResizeRequestRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInstanceGroupManagerResizeRequestRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInstanceGroupManagerResizeRequestsRequest $request, array $optionalArgs = []) + */ +final class InstanceGroupManagerResizeRequestsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InstanceGroupManagerResizeRequests'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php + * + * @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()} + * . + * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/get.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagerResizeRequestsClient/list.php + * + * @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..dc5ae3181a67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupManagersClient.php @@ -0,0 +1,920 @@ + abandonInstancesAsync(AbandonInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface applyUpdatesToInstancesAsync(ApplyUpdatesToInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface createInstancesAsync(CreateInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteInstancesAsync(DeleteInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deletePerInstanceConfigsAsync(DeletePerInstanceConfigsInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listErrorsAsync(ListErrorsInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listManagedInstancesAsync(ListManagedInstancesInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listPerInstanceConfigsAsync(ListPerInstanceConfigsInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchPerInstanceConfigsAsync(PatchPerInstanceConfigsInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface recreateInstancesAsync(RecreateInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface resizeAsync(ResizeInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface resumeInstancesAsync(ResumeInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface setInstanceTemplateAsync(SetInstanceTemplateInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface setTargetPoolsAsync(SetTargetPoolsInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface startInstancesAsync(StartInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopInstancesAsync(StopInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface suspendInstancesAsync(SuspendInstancesInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface updatePerInstanceConfigsAsync(UpdatePerInstanceConfigsInstanceGroupManagerRequest $request, array $optionalArgs = []) + */ +final class InstanceGroupManagersClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InstanceGroupManagers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} + * . + * + * @example samples/V1/InstanceGroupManagersClient/abandon_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/apply_updates_to_instances.php + * + * @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()} + * . + * + * @example samples/V1/InstanceGroupManagersClient/create_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/delete.php + * + * @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()} + * . + * + * @example samples/V1/InstanceGroupManagersClient/delete_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/delete_per_instance_configs.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/get.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/insert.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/list.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/list_errors.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/list_managed_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/list_per_instance_configs.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/patch.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/patch_per_instance_configs.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/recreate_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/resize.php + * + * @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(); + } + + /** + * Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is {@see InstanceGroupManagersClient::resumeInstancesAsync()} + * . + * + * @example samples/V1/InstanceGroupManagersClient/resume_instances.php + * + * @param ResumeInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resumeInstances(ResumeInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ResumeInstances', $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()} . + * + * @example samples/V1/InstanceGroupManagersClient/set_instance_template.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupManagersClient/set_target_pools.php + * + * @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(); + } + + /** + * Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is {@see InstanceGroupManagersClient::startInstancesAsync()} . + * + * @example samples/V1/InstanceGroupManagersClient/start_instances.php + * + * @param StartInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startInstances(StartInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StartInstances', $request, $callOptions)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is {@see InstanceGroupManagersClient::stopInstancesAsync()} . + * + * @example samples/V1/InstanceGroupManagersClient/stop_instances.php + * + * @param StopInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopInstances(StopInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopInstances', $request, $callOptions)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is {@see InstanceGroupManagersClient::suspendInstancesAsync()} + * . + * + * @example samples/V1/InstanceGroupManagersClient/suspend_instances.php + * + * @param SuspendInstancesInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suspendInstances(SuspendInstancesInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SuspendInstances', $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()} . + * + * @example samples/V1/InstanceGroupManagersClient/update_per_instance_configs.php + * + * @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..585480fabc00 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceGroupsClient.php @@ -0,0 +1,487 @@ + addInstancesAsync(AddInstancesInstanceGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListInstanceGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInstanceGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInstanceGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInstanceGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInstanceGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesInstanceGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeInstancesAsync(RemoveInstancesInstanceGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface setNamedPortsAsync(SetNamedPortsInstanceGroupRequest $request, array $optionalArgs = []) + */ +final class InstanceGroupsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InstanceGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/add_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/delete.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/get.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/insert.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/list.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/list_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/remove_instances.php + * + * @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()} . + * + * @example samples/V1/InstanceGroupsClient/set_named_ports.php + * + * @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..67bdea7935f6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceSettingsServiceClient.php @@ -0,0 +1,290 @@ + getAsync(GetInstanceSettingRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchInstanceSettingRequest $request, array $optionalArgs = []) + */ +final class InstanceSettingsServiceClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InstanceSettingsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InstanceSettingsServiceClient/get.php + * + * @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()} . + * + * @example samples/V1/InstanceSettingsServiceClient/patch.php + * + * @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..05f82dc11dce --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstanceTemplatesClient.php @@ -0,0 +1,460 @@ + aggregatedListAsync(AggregatedListInstanceTemplatesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInstanceTemplatesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsInstanceTemplateRequest $request, array $optionalArgs = []) + */ +final class InstanceTemplatesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InstanceTemplates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/delete.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/get.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/insert.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/list.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/InstanceTemplatesClient/test_iam_permissions.php + * + * @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..c75ba4b498d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstancesClient.php @@ -0,0 +1,1590 @@ + addAccessConfigAsync(AddAccessConfigInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface addResourcePoliciesAsync(AddResourcePoliciesInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface attachDiskAsync(AttachDiskInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface bulkInsertAsync(BulkInsertInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAccessConfigAsync(DeleteAccessConfigInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface detachDiskAsync(DetachDiskInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEffectiveFirewallsAsync(GetEffectiveFirewallsInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGuestAttributesAsync(GetGuestAttributesInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getScreenshotAsync(GetScreenshotInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getSerialPortOutputAsync(GetSerialPortOutputInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getShieldedInstanceIdentityAsync(GetShieldedInstanceIdentityInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listReferrersAsync(ListReferrersInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface performMaintenanceAsync(PerformMaintenanceInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeResourcePoliciesAsync(RemoveResourcePoliciesInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface resetAsync(ResetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface resumeAsync(ResumeInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface sendDiagnosticInterruptAsync(SendDiagnosticInterruptInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setDeletionProtectionAsync(SetDeletionProtectionInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setDiskAutoDeleteAsync(SetDiskAutoDeleteInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setMachineResourcesAsync(SetMachineResourcesInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setMachineTypeAsync(SetMachineTypeInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setMetadataAsync(SetMetadataInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setMinCpuPlatformAsync(SetMinCpuPlatformInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setNameAsync(SetNameInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSchedulingAsync(SetSchedulingInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSecurityPolicyAsync(SetSecurityPolicyInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setServiceAccountAsync(SetServiceAccountInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setShieldedInstanceIntegrityPolicyAsync(SetShieldedInstanceIntegrityPolicyInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setTagsAsync(SetTagsInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface simulateMaintenanceEventAsync(SimulateMaintenanceEventInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface startAsync(StartInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface startWithEncryptionKeyAsync(StartWithEncryptionKeyInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopAsync(StopInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface suspendAsync(SuspendInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAccessConfigAsync(UpdateAccessConfigInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDisplayDeviceAsync(UpdateDisplayDeviceInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateNetworkInterfaceAsync(UpdateNetworkInterfaceInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateShieldedInstanceConfigAsync(UpdateShieldedInstanceConfigInstanceRequest $request, array $optionalArgs = []) + */ +final class InstancesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Instances'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InstancesClient/add_access_config.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/add_resource_policies.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/attach_disk.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/bulk_insert.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/delete.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/delete_access_config.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/detach_disk.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/get.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/get_effective_firewalls.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/get_guest_attributes.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/get_screenshot.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/get_serial_port_output.php + * + * @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()} + * . + * + * @example samples/V1/InstancesClient/get_shielded_instance_identity.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/insert.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/list.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/list_referrers.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/perform_maintenance.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/remove_resource_policies.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/reset.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/resume.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/send_diagnostic_interrupt.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_deletion_protection.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_disk_auto_delete.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_machine_resources.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_machine_type.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_metadata.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_min_cpu_platform.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_name.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_scheduling.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_security_policy.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_service_account.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_shielded_instance_integrity_policy.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/set_tags.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/simulate_maintenance_event.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/start.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/start_with_encryption_key.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/stop.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/suspend.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/update.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/update_access_config.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/update_display_device.php + * + * @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()} . + * + * @example samples/V1/InstancesClient/update_network_interface.php + * + * @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()} + * . + * + * @example samples/V1/InstancesClient/update_shielded_instance_config.php + * + * @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..6ba1c403bc93 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InstantSnapshotsClient.php @@ -0,0 +1,489 @@ + aggregatedListAsync(AggregatedListInstantSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInstantSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsInstantSnapshotRequest $request, array $optionalArgs = []) + */ +final class InstantSnapshotsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InstantSnapshots'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/delete.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/get.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/insert.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/list.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/InstantSnapshotsClient/test_iam_permissions.php + * + * @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..be596130fa9b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectAttachmentsClient.php @@ -0,0 +1,432 @@ + aggregatedListAsync(AggregatedListInterconnectAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteInterconnectAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInterconnectAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInterconnectAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInterconnectAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchInterconnectAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsInterconnectAttachmentRequest $request, array $optionalArgs = []) + */ +final class InterconnectAttachmentsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InterconnectAttachments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} + * . + * + * @example samples/V1/InterconnectAttachmentsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/InterconnectAttachmentsClient/delete.php + * + * @param DeleteInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/InterconnectAttachmentsClient/get.php + * + * @param GetInterconnectAttachmentRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return InterconnectAttachment + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/InterconnectAttachmentsClient/insert.php + * + * @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()} . + * + * @example samples/V1/InterconnectAttachmentsClient/list.php + * + * @param ListInterconnectAttachmentsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/InterconnectAttachmentsClient/patch.php + * + * @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()} . + * + * @example samples/V1/InterconnectAttachmentsClient/set_labels.php + * + * @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..48ccfbd53595 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectLocationsClient.php @@ -0,0 +1,235 @@ + getAsync(GetInterconnectLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInterconnectLocationsRequest $request, array $optionalArgs = []) + */ +final class InterconnectLocationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InterconnectLocations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InterconnectLocationsClient/get.php + * + * @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()} . + * + * @example samples/V1/InterconnectLocationsClient/list.php + * + * @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..504123c9581f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectRemoteLocationsClient.php @@ -0,0 +1,235 @@ + getAsync(GetInterconnectRemoteLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInterconnectRemoteLocationsRequest $request, array $optionalArgs = []) + */ +final class InterconnectRemoteLocationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.InterconnectRemoteLocations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InterconnectRemoteLocationsClient/get.php + * + * @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()} . + * + * @example samples/V1/InterconnectRemoteLocationsClient/list.php + * + * @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..787033268ca8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/InterconnectsClient.php @@ -0,0 +1,460 @@ + deleteAsync(DeleteInterconnectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetInterconnectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDiagnosticsAsync(GetDiagnosticsInterconnectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getMacsecConfigAsync(GetMacsecConfigInterconnectRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertInterconnectRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListInterconnectsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchInterconnectRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsInterconnectRequest $request, array $optionalArgs = []) + */ +final class InterconnectsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Interconnects'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/InterconnectsClient/delete.php + * + * @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()} . + * + * @example samples/V1/InterconnectsClient/get.php + * + * @param GetInterconnectRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Interconnect + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/InterconnectsClient/get_diagnostics.php + * + * @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()} . + * + * @example samples/V1/InterconnectsClient/get_macsec_config.php + * + * @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()} . + * + * @example samples/V1/InterconnectsClient/insert.php + * + * @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()} . + * + * @example samples/V1/InterconnectsClient/list.php + * + * @param ListInterconnectsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/InterconnectsClient/patch.php + * + * @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()} . + * + * @example samples/V1/InterconnectsClient/set_labels.php + * + * @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..9fd2a879e15b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/LicenseCodesClient.php @@ -0,0 +1,235 @@ + getAsync(GetLicenseCodeRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsLicenseCodeRequest $request, array $optionalArgs = []) + */ +final class LicenseCodesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.LicenseCodes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/LicenseCodesClient/get.php + * + * @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()} . + * + * @example samples/V1/LicenseCodesClient/test_iam_permissions.php + * + * @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..d5fb37c01973 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/LicensesClient.php @@ -0,0 +1,432 @@ + deleteAsync(DeleteLicenseRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetLicenseRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyLicenseRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertLicenseRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListLicensesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyLicenseRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsLicenseRequest $request, array $optionalArgs = []) + */ +final class LicensesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Licenses'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/LicensesClient/delete.php + * + * @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()} . + * + * @example samples/V1/LicensesClient/get.php + * + * @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()} . + * + * @example samples/V1/LicensesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/LicensesClient/insert.php + * + * @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()} . + * + * @example samples/V1/LicensesClient/list.php + * + * @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()} . + * + * @example samples/V1/LicensesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/LicensesClient/test_iam_permissions.php + * + * @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..00c74023ab85 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/MachineImagesClient.php @@ -0,0 +1,432 @@ + deleteAsync(DeleteMachineImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetMachineImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyMachineImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertMachineImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListMachineImagesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyMachineImageRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsMachineImageRequest $request, array $optionalArgs = []) + */ +final class MachineImagesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.MachineImages'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/delete.php + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/get.php + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/insert.php + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/list.php + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/MachineImagesClient/test_iam_permissions.php + * + * @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..af1818035778 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/MachineTypesClient.php @@ -0,0 +1,263 @@ + aggregatedListAsync(AggregatedListMachineTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetMachineTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListMachineTypesRequest $request, array $optionalArgs = []) + */ +final class MachineTypesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.MachineTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/MachineTypesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/MachineTypesClient/get.php + * + * @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()} . + * + * @example samples/V1/MachineTypesClient/list.php + * + * @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..f04985259c8d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkAttachmentsClient.php @@ -0,0 +1,490 @@ + aggregatedListAsync(AggregatedListNetworkAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNetworkAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNetworkAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyNetworkAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNetworkAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNetworkAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchNetworkAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyNetworkAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsNetworkAttachmentRequest $request, array $optionalArgs = []) + */ +final class NetworkAttachmentsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NetworkAttachments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/delete.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/get.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/insert.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/list.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/patch.php + * + * @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()} . + * + * @example samples/V1/NetworkAttachmentsClient/set_iam_policy.php + * + * @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()} + * . + * + * @example samples/V1/NetworkAttachmentsClient/test_iam_permissions.php + * + * @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..8c896f15ce67 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEdgeSecurityServicesClient.php @@ -0,0 +1,376 @@ + aggregatedListAsync(AggregatedListNetworkEdgeSecurityServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNetworkEdgeSecurityServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNetworkEdgeSecurityServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNetworkEdgeSecurityServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchNetworkEdgeSecurityServiceRequest $request, array $optionalArgs = []) + */ +final class NetworkEdgeSecurityServicesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NetworkEdgeSecurityServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NetworkEdgeSecurityServicesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/NetworkEdgeSecurityServicesClient/delete.php + * + * @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()} . + * + * @example samples/V1/NetworkEdgeSecurityServicesClient/get.php + * + * @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()} . + * + * @example samples/V1/NetworkEdgeSecurityServicesClient/insert.php + * + * @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()} . + * + * @example samples/V1/NetworkEdgeSecurityServicesClient/patch.php + * + * @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..aa52b24c1494 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkEndpointGroupsClient.php @@ -0,0 +1,492 @@ + aggregatedListAsync(AggregatedListNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface attachNetworkEndpointsAsync(AttachNetworkEndpointsNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface detachNetworkEndpointsAsync(DetachNetworkEndpointsNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNetworkEndpointsAsync(ListNetworkEndpointsNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsNetworkEndpointGroupRequest $request, array $optionalArgs = []) + */ +final class NetworkEndpointGroupsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NetworkEndpointGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/attach_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/delete.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/detach_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/get.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/insert.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/list.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/list_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/NetworkEndpointGroupsClient/test_iam_permissions.php + * + * @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..48022b89af49 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkFirewallPoliciesClient.php @@ -0,0 +1,690 @@ + addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface addRuleAsync(AddRuleNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAssociationAsync(GetAssociationNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRuleAsync(GetRuleNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNetworkFirewallPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + */ +final class NetworkFirewallPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NetworkFirewallPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} + * . + * + * @example samples/V1/NetworkFirewallPoliciesClient/add_association.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/add_rule.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/clone_rules.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/get.php + * + * @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()} + * . + * + * @example samples/V1/NetworkFirewallPoliciesClient/get_association.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/get_rule.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/patch.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/patch_rule.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/remove_association.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/remove_rule.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NetworkFirewallPoliciesClient/test_iam_permissions.php + * + * @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/NetworkProfilesClient.php b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkProfilesClient.php new file mode 100644 index 000000000000..676dc131107d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworkProfilesClient.php @@ -0,0 +1,235 @@ + getAsync(GetNetworkProfileRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNetworkProfilesRequest $request, array $optionalArgs = []) + */ +final class NetworkProfilesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NetworkProfiles'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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/network_profiles_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_profiles_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_profiles_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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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 network profile. + * + * The async variant is {@see NetworkProfilesClient::getAsync()} . + * + * @example samples/V1/NetworkProfilesClient/get.php + * + * @param GetNetworkProfileRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkProfile + * + * @throws ApiException Thrown if the API call fails. + */ + public function get(GetNetworkProfileRequest $request, array $callOptions = []): NetworkProfile + { + return $this->startApiCall('Get', $request, $callOptions)->wait(); + } + + /** + * Retrieves a list of network profiles available to the specified project. + * + * The async variant is {@see NetworkProfilesClient::listAsync()} . + * + * @example samples/V1/NetworkProfilesClient/list.php + * + * @param ListNetworkProfilesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return NetworkProfilesListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function list(ListNetworkProfilesRequest $request, array $callOptions = []): NetworkProfilesListResponse + { + return $this->startApiCall('List', $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..c54a12da6541 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NetworksClient.php @@ -0,0 +1,543 @@ + addPeeringAsync(AddPeeringNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEffectiveFirewallsAsync(GetEffectiveFirewallsNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNetworksRequest $request, array $optionalArgs = []) + * @method PromiseInterface listPeeringRoutesAsync(ListPeeringRoutesNetworksRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface removePeeringAsync(RemovePeeringNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface switchToCustomModeAsync(SwitchToCustomModeNetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface updatePeeringAsync(UpdatePeeringNetworkRequest $request, array $optionalArgs = []) + */ +final class NetworksClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Networks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NetworksClient/add_peering.php + * + * @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()} . + * + * @example samples/V1/NetworksClient/delete.php + * + * @param DeleteNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function delete(DeleteNetworkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('Delete', $request, $callOptions)->wait(); + } + + /** + * Returns the specified network. + * + * The async variant is {@see NetworksClient::getAsync()} . + * + * @example samples/V1/NetworksClient/get.php + * + * @param GetNetworkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Network + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/NetworksClient/get_effective_firewalls.php + * + * @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()} . + * + * @example samples/V1/NetworksClient/insert.php + * + * @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()} . + * + * @example samples/V1/NetworksClient/list.php + * + * @param ListNetworksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/NetworksClient/list_peering_routes.php + * + * @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 routingConfig can be modified. + * + * The async variant is {@see NetworksClient::patchAsync()} . + * + * @example samples/V1/NetworksClient/patch.php + * + * @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()} . + * + * @example samples/V1/NetworksClient/remove_peering.php + * + * @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()} . + * + * @example samples/V1/NetworksClient/switch_to_custom_mode.php + * + * @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()} . + * + * @example samples/V1/NetworksClient/update_peering.php + * + * @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..c7fddebb9e97 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NodeGroupsClient.php @@ -0,0 +1,657 @@ + addNodesAsync(AddNodesNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListNodeGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteNodesAsync(DeleteNodesNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNodeGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNodesAsync(ListNodesNodeGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface performMaintenanceAsync(PerformMaintenanceNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface setNodeTemplateAsync(SetNodeTemplateNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface simulateMaintenanceEventAsync(SimulateMaintenanceEventNodeGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsNodeGroupRequest $request, array $optionalArgs = []) + */ +final class NodeGroupsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NodeGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/add_nodes.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/delete.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/delete_nodes.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/get.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/insert.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/list.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/list_nodes.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/patch.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/perform_maintenance.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/set_node_template.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/simulate_maintenance_event.php + * + * @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()} . + * + * @example samples/V1/NodeGroupsClient/test_iam_permissions.php + * + * @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..db0416b3a83a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NodeTemplatesClient.php @@ -0,0 +1,461 @@ + aggregatedListAsync(AggregatedListNodeTemplatesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteNodeTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNodeTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyNodeTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertNodeTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNodeTemplatesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyNodeTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsNodeTemplateRequest $request, array $optionalArgs = []) + */ +final class NodeTemplatesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NodeTemplates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/delete.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/get.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/insert.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/list.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/NodeTemplatesClient/test_iam_permissions.php + * + * @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..f3ba0d0ead5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/NodeTypesClient.php @@ -0,0 +1,263 @@ + aggregatedListAsync(AggregatedListNodeTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetNodeTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListNodeTypesRequest $request, array $optionalArgs = []) + */ +final class NodeTypesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.NodeTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/NodeTypesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/NodeTypesClient/get.php + * + * @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()} . + * + * @example samples/V1/NodeTypesClient/list.php + * + * @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..e78d753d36be --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/PacketMirroringsClient.php @@ -0,0 +1,432 @@ + aggregatedListAsync(AggregatedListPacketMirroringsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeletePacketMirroringRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetPacketMirroringRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertPacketMirroringRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListPacketMirroringsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchPacketMirroringRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsPacketMirroringRequest $request, array $optionalArgs = []) + */ +final class PacketMirroringsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.PacketMirrorings'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/delete.php + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/get.php + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/insert.php + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/list.php + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/patch.php + * + * @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()} . + * + * @example samples/V1/PacketMirroringsClient/test_iam_permissions.php + * + * @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..9c571cedeb3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ProjectsClient.php @@ -0,0 +1,626 @@ + disableXpnHostAsync(DisableXpnHostProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface disableXpnResourceAsync(DisableXpnResourceProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface enableXpnHostAsync(EnableXpnHostProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface enableXpnResourceAsync(EnableXpnResourceProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getXpnHostAsync(GetXpnHostProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface getXpnResourcesAsync(GetXpnResourcesProjectsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listXpnHostsAsync(ListXpnHostsProjectsRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveDiskAsync(MoveDiskProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface moveInstanceAsync(MoveInstanceProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface setCloudArmorTierAsync(SetCloudArmorTierProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface setCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface setDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest $request, array $optionalArgs = []) + * @method PromiseInterface setUsageExportBucketAsync(SetUsageExportBucketProjectRequest $request, array $optionalArgs = []) + */ +final class ProjectsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Projects'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ProjectsClient/disable_xpn_host.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/disable_xpn_resource.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/enable_xpn_host.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/enable_xpn_resource.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/get.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/get_xpn_host.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/get_xpn_resources.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/list_xpn_hosts.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/move_disk.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/move_instance.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/set_cloud_armor_tier.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/set_common_instance_metadata.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/set_default_network_tier.php + * + * @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()} . + * + * @example samples/V1/ProjectsClient/set_usage_export_bucket.php + * + * @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..df6b9b0d994d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/PublicAdvertisedPrefixesClient.php @@ -0,0 +1,430 @@ + announceAsync(AnnouncePublicAdvertisedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeletePublicAdvertisedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetPublicAdvertisedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertPublicAdvertisedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListPublicAdvertisedPrefixesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchPublicAdvertisedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface withdrawAsync(WithdrawPublicAdvertisedPrefixeRequest $request, array $optionalArgs = []) + */ +final class PublicAdvertisedPrefixesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.PublicAdvertisedPrefixes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/announce.php + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/delete.php + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/get.php + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/insert.php + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/list.php + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/patch.php + * + * @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()} . + * + * @example samples/V1/PublicAdvertisedPrefixesClient/withdraw.php + * + * @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..738dcb4be96e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/PublicDelegatedPrefixesClient.php @@ -0,0 +1,460 @@ + aggregatedListAsync(AggregatedListPublicDelegatedPrefixesRequest $request, array $optionalArgs = []) + * @method PromiseInterface announceAsync(AnnouncePublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeletePublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListPublicDelegatedPrefixesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + * @method PromiseInterface withdrawAsync(WithdrawPublicDelegatedPrefixeRequest $request, array $optionalArgs = []) + */ +final class PublicDelegatedPrefixesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.PublicDelegatedPrefixes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} + * . + * + * @example samples/V1/PublicDelegatedPrefixesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/announce.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/delete.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/get.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/insert.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/list.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/patch.php + * + * @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()} . + * + * @example samples/V1/PublicDelegatedPrefixesClient/withdraw.php + * + * @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..cbfe34430afc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionAutoscalersClient.php @@ -0,0 +1,403 @@ + deleteAsync(DeleteRegionAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionAutoscalersRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionAutoscalerRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRegionAutoscalerRequest $request, array $optionalArgs = []) + */ +final class RegionAutoscalersClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionAutoscalers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionAutoscalersClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionAutoscalersClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionAutoscalersClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionAutoscalersClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionAutoscalersClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionAutoscalersClient/update.php + * + * @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..f81de6bd8016 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionBackendServicesClient.php @@ -0,0 +1,576 @@ + deleteAsync(DeleteRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getHealthAsync(GetHealthRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionBackendServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listUsableAsync(ListUsableRegionBackendServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSecurityPolicyAsync(SetSecurityPolicyRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRegionBackendServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRegionBackendServiceRequest $request, array $optionalArgs = []) + */ +final class RegionBackendServicesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionBackendServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/get_health.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/list.php + * + * @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 a list of all usable backend services in the specified project in the given region. + * + * The async variant is {@see RegionBackendServicesClient::listUsableAsync()} . + * + * @example samples/V1/RegionBackendServicesClient/list_usable.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/set_security_policy.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/RegionBackendServicesClient/update.php + * + * @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..4e863b46533f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionCommitmentsClient.php @@ -0,0 +1,375 @@ + aggregatedListAsync(AggregatedListRegionCommitmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionCommitmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionCommitmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRegionCommitmentRequest $request, array $optionalArgs = []) + */ +final class RegionCommitmentsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionCommitments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionCommitmentsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/RegionCommitmentsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionCommitmentsClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionCommitmentsClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionCommitmentsClient/update.php + * + * @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..dfaaa55184d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionDiskTypesClient.php @@ -0,0 +1,235 @@ + getAsync(GetRegionDiskTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionDiskTypesRequest $request, array $optionalArgs = []) + */ +final class RegionDiskTypesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionDiskTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionDiskTypesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionDiskTypesClient/list.php + * + * @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..f1dc6229fd3b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionDisksClient.php @@ -0,0 +1,714 @@ + addResourcePoliciesAsync(AddResourcePoliciesRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface bulkInsertAsync(BulkInsertRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface createSnapshotAsync(CreateSnapshotRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionDisksRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeResourcePoliciesAsync(RemoveResourcePoliciesRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface resizeAsync(ResizeRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface startAsyncReplicationAsync(StartAsyncReplicationRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopAsyncReplicationAsync(StopAsyncReplicationRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopGroupAsyncReplicationAsync(StopGroupAsyncReplicationRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRegionDiskRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRegionDiskRequest $request, array $optionalArgs = []) + */ +final class RegionDisksClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionDisks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/add_resource_policies.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/bulk_insert.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/create_snapshot.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/remove_resource_policies.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/resize.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/start_async_replication.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/stop_async_replication.php + * + * @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()} + * . + * + * @example samples/V1/RegionDisksClient/stop_group_async_replication.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/RegionDisksClient/update.php + * + * @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..975254ddac9e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthCheckServicesClient.php @@ -0,0 +1,375 @@ + deleteAsync(DeleteRegionHealthCheckServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionHealthCheckServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionHealthCheckServiceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionHealthCheckServicesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionHealthCheckServiceRequest $request, array $optionalArgs = []) + */ +final class RegionHealthCheckServicesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionHealthCheckServices'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionHealthCheckServicesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionHealthCheckServicesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionHealthCheckServicesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionHealthCheckServicesClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionHealthCheckServicesClient/patch.php + * + * @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..3d153486f1cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionHealthChecksClient.php @@ -0,0 +1,403 @@ + deleteAsync(DeleteRegionHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionHealthChecksRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionHealthCheckRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRegionHealthCheckRequest $request, array $optionalArgs = []) + */ +final class RegionHealthChecksClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionHealthChecks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionHealthChecksClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionHealthChecksClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionHealthChecksClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionHealthChecksClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionHealthChecksClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionHealthChecksClient/update.php + * + * @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..c55b0924436a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupManagersClient.php @@ -0,0 +1,896 @@ + abandonInstancesAsync(AbandonInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface applyUpdatesToInstancesAsync(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface createInstancesAsync(CreateInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteInstancesAsync(DeleteInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface deletePerInstanceConfigsAsync(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listErrorsAsync(ListErrorsRegionInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listManagedInstancesAsync(ListManagedInstancesRegionInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface listPerInstanceConfigsAsync(ListPerInstanceConfigsRegionInstanceGroupManagersRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchPerInstanceConfigsAsync(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface recreateInstancesAsync(RecreateInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface resizeAsync(ResizeRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface resumeInstancesAsync(ResumeInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface setInstanceTemplateAsync(SetInstanceTemplateRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface setTargetPoolsAsync(SetTargetPoolsRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface startInstancesAsync(StartInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface stopInstancesAsync(StopInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface suspendInstancesAsync(SuspendInstancesRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + * @method PromiseInterface updatePerInstanceConfigsAsync(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest $request, array $optionalArgs = []) + */ +final class RegionInstanceGroupManagersClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceGroupManagers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/abandon_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/apply_updates_to_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/create_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/delete_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/delete_per_instance_configs.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/list.php + * + * @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()} + * . + * + * @example samples/V1/RegionInstanceGroupManagersClient/list_errors.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/list_managed_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/list_per_instance_configs.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/patch_per_instance_configs.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/recreate_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/resize.php + * + * @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(); + } + + /** + * Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::resumeInstancesAsync()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/resume_instances.php + * + * @param ResumeInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function resumeInstances(ResumeInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ResumeInstances', $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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/set_instance_template.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/set_target_pools.php + * + * @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(); + } + + /** + * Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::startInstancesAsync()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/start_instances.php + * + * @param StartInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function startInstances(StartInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StartInstances', $request, $callOptions)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::stopInstancesAsync()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/stop_instances.php + * + * @param StopInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function stopInstances(StopInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('StopInstances', $request, $callOptions)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request. + * + * The async variant is + * {@see RegionInstanceGroupManagersClient::suspendInstancesAsync()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/suspend_instances.php + * + * @param SuspendInstancesRegionInstanceGroupManagerRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function suspendInstances(SuspendInstancesRegionInstanceGroupManagerRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SuspendInstances', $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()} . + * + * @example samples/V1/RegionInstanceGroupManagersClient/update_per_instance_configs.php + * + * @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..18f76e5c1299 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceGroupsClient.php @@ -0,0 +1,347 @@ + getAsync(GetRegionInstanceGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionInstanceGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listInstancesAsync(ListInstancesRegionInstanceGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setNamedPortsAsync(SetNamedPortsRegionInstanceGroupRequest $request, array $optionalArgs = []) + */ +final class RegionInstanceGroupsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupsClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupsClient/list_instances.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceGroupsClient/set_named_ports.php + * + * @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..2ce6e4730892 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstanceTemplatesClient.php @@ -0,0 +1,347 @@ + deleteAsync(DeleteRegionInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionInstanceTemplateRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionInstanceTemplatesRequest $request, array $optionalArgs = []) + */ +final class RegionInstanceTemplatesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstanceTemplates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionInstanceTemplatesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceTemplatesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceTemplatesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionInstanceTemplatesClient/list.php + * + * @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..989e12bd14ea --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstancesClient.php @@ -0,0 +1,261 @@ + bulkInsertAsync(BulkInsertRegionInstanceRequest $request, array $optionalArgs = []) + */ +final class RegionInstancesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstances'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionInstancesClient/bulk_insert.php + * + * @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..de1cae563eef --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionInstantSnapshotsClient.php @@ -0,0 +1,462 @@ + deleteAsync(DeleteRegionInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRegionInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionInstantSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRegionInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsRegionInstantSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRegionInstantSnapshotRequest $request, array $optionalArgs = []) + */ +final class RegionInstantSnapshotsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionInstantSnapshots'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/RegionInstantSnapshotsClient/test_iam_permissions.php + * + * @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..c574331f7b4a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkEndpointGroupsClient.php @@ -0,0 +1,434 @@ + attachNetworkEndpointsAsync(AttachNetworkEndpointsRegionNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteRegionNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface detachNetworkEndpointsAsync(DetachNetworkEndpointsRegionNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionNetworkEndpointGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listNetworkEndpointsAsync(ListNetworkEndpointsRegionNetworkEndpointGroupsRequest $request, array $optionalArgs = []) + */ +final class RegionNetworkEndpointGroupsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionNetworkEndpointGroups'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/attach_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/detach_network_endpoints.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkEndpointGroupsClient/list_network_endpoints.php + * + * @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..692f7c1f3551 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNetworkFirewallPoliciesClient.php @@ -0,0 +1,728 @@ + addAssociationAsync(AddAssociationRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface addRuleAsync(AddRuleRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface cloneRulesAsync(CloneRulesRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAssociationAsync(GetAssociationRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getEffectiveFirewallsAsync(GetEffectiveFirewallsRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRuleAsync(GetRuleRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionNetworkFirewallPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchRuleAsync(PatchRuleRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeAssociationAsync(RemoveAssociationRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeRuleAsync(RemoveRuleRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRegionNetworkFirewallPolicyRequest $request, array $optionalArgs = []) + */ +final class RegionNetworkFirewallPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionNetworkFirewallPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/add_association.php + * + * @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()} + * . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/add_rule.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/clone_rules.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_association.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_effective_firewalls.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_iam_policy.php + * + * @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()} + * . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/get_rule.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/patch_rule.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/remove_association.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/remove_rule.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/RegionNetworkFirewallPoliciesClient/test_iam_permissions.php + * + * @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..147784d5f845 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionNotificationEndpointsClient.php @@ -0,0 +1,347 @@ + deleteAsync(DeleteRegionNotificationEndpointRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionNotificationEndpointRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionNotificationEndpointRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionNotificationEndpointsRequest $request, array $optionalArgs = []) + */ +final class RegionNotificationEndpointsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionNotificationEndpoints'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionNotificationEndpointsClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionNotificationEndpointsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionNotificationEndpointsClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionNotificationEndpointsClient/list.php + * + * @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..3b75196d5fe7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionOperationsClient.php @@ -0,0 +1,291 @@ + deleteAsync(DeleteRegionOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionOperationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface waitAsync(WaitRegionOperationRequest $request, array $optionalArgs = []) + */ +final class RegionOperationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionOperationsClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionOperationsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionOperationsClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionOperationsClient/wait.php + * + * @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..359997cb9658 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSecurityPoliciesClient.php @@ -0,0 +1,516 @@ + addRuleAsync(AddRuleRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRuleAsync(GetRuleRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionSecurityPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchRuleAsync(PatchRuleRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeRuleAsync(RemoveRuleRegionSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsRegionSecurityPolicyRequest $request, array $optionalArgs = []) + */ +final class RegionSecurityPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionSecurityPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/add_rule.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/get_rule.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/patch_rule.php + * + * @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()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/remove_rule.php + * + * @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(); + } + + /** + * Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. + * + * The async variant is {@see RegionSecurityPoliciesClient::setLabelsAsync()} . + * + * @example samples/V1/RegionSecurityPoliciesClient/set_labels.php + * + * @param SetLabelsRegionSecurityPolicyRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of 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(SetLabelsRegionSecurityPolicyRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('SetLabels', $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..dd2ce90d91c0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslCertificatesClient.php @@ -0,0 +1,347 @@ + deleteAsync(DeleteRegionSslCertificateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionSslCertificateRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionSslCertificateRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionSslCertificatesRequest $request, array $optionalArgs = []) + */ +final class RegionSslCertificatesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionSslCertificates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionSslCertificatesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionSslCertificatesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionSslCertificatesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionSslCertificatesClient/list.php + * + * @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..d5b15c43e19e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionSslPoliciesClient.php @@ -0,0 +1,405 @@ + deleteAsync(DeleteRegionSslPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionSslPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionSslPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionSslPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAvailableFeaturesAsync(ListAvailableFeaturesRegionSslPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionSslPolicyRequest $request, array $optionalArgs = []) + */ +final class RegionSslPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionSslPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionSslPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionSslPoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionSslPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionSslPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionSslPoliciesClient/list_available_features.php + * + * @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()} . + * + * @example samples/V1/RegionSslPoliciesClient/patch.php + * + * @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..6e707eaab89d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpProxiesClient.php @@ -0,0 +1,375 @@ + deleteAsync(DeleteRegionTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionTargetHttpProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setUrlMapAsync(SetUrlMapRegionTargetHttpProxyRequest $request, array $optionalArgs = []) + */ +final class RegionTargetHttpProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionTargetHttpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpProxiesClient/set_url_map.php + * + * @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..ced5696c6ba2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetHttpsProxiesClient.php @@ -0,0 +1,432 @@ + deleteAsync(DeleteRegionTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionTargetHttpsProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSslCertificatesAsync(SetSslCertificatesRegionTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setUrlMapAsync(SetUrlMapRegionTargetHttpsProxyRequest $request, array $optionalArgs = []) + */ +final class RegionTargetHttpsProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionTargetHttpsProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/set_ssl_certificates.php + * + * @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()} . + * + * @example samples/V1/RegionTargetHttpsProxiesClient/set_url_map.php + * + * @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..611a15a4b250 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionTargetTcpProxiesClient.php @@ -0,0 +1,347 @@ + deleteAsync(DeleteRegionTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionTargetTcpProxiesRequest $request, array $optionalArgs = []) + */ +final class RegionTargetTcpProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionTargetTcpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionTargetTcpProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionTargetTcpProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionTargetTcpProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionTargetTcpProxiesClient/list.php + * + * @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..d18143c18064 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionUrlMapsClient.php @@ -0,0 +1,432 @@ + deleteAsync(DeleteRegionUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRegionUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRegionUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionUrlMapsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRegionUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRegionUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface validateAsync(ValidateRegionUrlMapRequest $request, array $optionalArgs = []) + */ +final class RegionUrlMapsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionUrlMaps'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/delete.php + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/get.php + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/insert.php + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/list.php + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/patch.php + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/update.php + * + * @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()} . + * + * @example samples/V1/RegionUrlMapsClient/validate.php + * + * @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..44afcc070741 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionZonesClient.php @@ -0,0 +1,206 @@ + listAsync(ListRegionZonesRequest $request, array $optionalArgs = []) + */ +final class RegionZonesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.RegionZones'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RegionZonesClient/list.php + * + * @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..e95856e642bf --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RegionsClient.php @@ -0,0 +1,235 @@ + getAsync(GetRegionRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRegionsRequest $request, array $optionalArgs = []) + */ +final class RegionsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Regions'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method. + * + * The async variant is {@see RegionsClient::getAsync()} . + * + * @example samples/V1/RegionsClient/get.php + * + * @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. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method. + * + * The async variant is {@see RegionsClient::listAsync()} . + * + * @example samples/V1/RegionsClient/list.php + * + * @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..9a4319e110d9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ReservationsClient.php @@ -0,0 +1,517 @@ + aggregatedListAsync(AggregatedListReservationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListReservationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface resizeAsync(ResizeReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsReservationRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateReservationRequest $request, array $optionalArgs = []) + */ +final class ReservationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Reservations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ReservationsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/delete.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/get.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/insert.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/list.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/resize.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/test_iam_permissions.php + * + * @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()} . + * + * @example samples/V1/ReservationsClient/update.php + * + * @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..963321b5d4a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ResourcePoliciesClient.php @@ -0,0 +1,489 @@ + aggregatedListAsync(AggregatedListResourcePoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteResourcePolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetResourcePolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyResourcePolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertResourcePolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListResourcePoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchResourcePolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyResourcePolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsResourcePolicyRequest $request, array $optionalArgs = []) + */ +final class ResourcePoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.ResourcePolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/patch.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ResourcePoliciesClient/test_iam_permissions.php + * + * @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..ceccffdf0da9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RoutersClient.php @@ -0,0 +1,546 @@ + aggregatedListAsync(AggregatedListRoutersRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getNatIpInfoAsync(GetNatIpInfoRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface getNatMappingInfoAsync(GetNatMappingInfoRoutersRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRouterStatusAsync(GetRouterStatusRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRoutersRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface previewAsync(PreviewRouterRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateRouterRequest $request, array $optionalArgs = []) + */ +final class RoutersClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Routers'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RoutersClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/delete.php + * + * @param DeleteRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/RoutersClient/get.php + * + * @param GetRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Router + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/RoutersClient/get_nat_ip_info.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/get_nat_mapping_info.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/get_router_status.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/insert.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/list.php + * + * @param ListRoutersRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/RoutersClient/patch.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/preview.php + * + * @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()} . + * + * @example samples/V1/RoutersClient/update.php + * + * @param UpdateRouterRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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..020b87239a5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/RoutesClient.php @@ -0,0 +1,346 @@ + deleteAsync(DeleteRouteRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetRouteRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertRouteRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListRoutesRequest $request, array $optionalArgs = []) + */ +final class RoutesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Routes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/RoutesClient/delete.php + * + * @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()} . + * + * @example samples/V1/RoutesClient/get.php + * + * @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()} . + * + * @example samples/V1/RoutesClient/insert.php + * + * @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()} . + * + * @example samples/V1/RoutesClient/list.php + * + * @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..9c92e6ff8219 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SecurityPoliciesClient.php @@ -0,0 +1,573 @@ + addRuleAsync(AddRuleSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListSecurityPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getRuleAsync(GetRuleSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListSecurityPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listPreconfiguredExpressionSetsAsync(ListPreconfiguredExpressionSetsSecurityPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchRuleAsync(PatchRuleSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeRuleAsync(RemoveRuleSecurityPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsSecurityPolicyRequest $request, array $optionalArgs = []) + */ +final class SecurityPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.SecurityPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/add_rule.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/get_rule.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/list_preconfigured_expression_sets.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/patch.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/patch_rule.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/remove_rule.php + * + * @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()} . + * + * @example samples/V1/SecurityPoliciesClient/set_labels.php + * + * @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..3aeb083af9a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ServiceAttachmentsClient.php @@ -0,0 +1,490 @@ + aggregatedListAsync(AggregatedListServiceAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteServiceAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetServiceAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyServiceAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertServiceAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListServiceAttachmentsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchServiceAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyServiceAttachmentRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsServiceAttachmentRequest $request, array $optionalArgs = []) + */ +final class ServiceAttachmentsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.ServiceAttachments'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/delete.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/get.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/insert.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/list.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/patch.php + * + * @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()} . + * + * @example samples/V1/ServiceAttachmentsClient/set_iam_policy.php + * + * @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()} + * . + * + * @example samples/V1/ServiceAttachmentsClient/test_iam_permissions.php + * + * @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..a3a7e1719ed4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotSettingsServiceClient.php @@ -0,0 +1,289 @@ + getAsync(GetSnapshotSettingRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchSnapshotSettingRequest $request, array $optionalArgs = []) + */ +final class SnapshotSettingsServiceClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.SnapshotSettingsService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/SnapshotSettingsServiceClient/get.php + * + * @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()} . + * + * @example samples/V1/SnapshotSettingsServiceClient/patch.php + * + * @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..7c8346c80da8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SnapshotsClient.php @@ -0,0 +1,460 @@ + deleteAsync(DeleteSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicySnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListSnapshotsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicySnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsSnapshotRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsSnapshotRequest $request, array $optionalArgs = []) + */ +final class SnapshotsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Snapshots'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/delete.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/get.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/insert.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/list.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/SnapshotsClient/test_iam_permissions.php + * + * @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..eb1e634ee58f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SslCertificatesClient.php @@ -0,0 +1,374 @@ + aggregatedListAsync(AggregatedListSslCertificatesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteSslCertificateRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetSslCertificateRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertSslCertificateRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListSslCertificatesRequest $request, array $optionalArgs = []) + */ +final class SslCertificatesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.SslCertificates'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/SslCertificatesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/SslCertificatesClient/delete.php + * + * @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()} . + * + * @example samples/V1/SslCertificatesClient/get.php + * + * @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()} . + * + * @example samples/V1/SslCertificatesClient/insert.php + * + * @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()} . + * + * @example samples/V1/SslCertificatesClient/list.php + * + * @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..a2d87cb2bb51 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SslPoliciesClient.php @@ -0,0 +1,431 @@ + aggregatedListAsync(AggregatedListSslPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteSslPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetSslPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertSslPolicyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListSslPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAvailableFeaturesAsync(ListAvailableFeaturesSslPoliciesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchSslPolicyRequest $request, array $optionalArgs = []) + */ +final class SslPoliciesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.SslPolicies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/delete.php + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/get.php + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/insert.php + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/list.php + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/list_available_features.php + * + * @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()} . + * + * @example samples/V1/SslPoliciesClient/patch.php + * + * @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..ff727ba4fecf --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolTypesClient.php @@ -0,0 +1,263 @@ + aggregatedListAsync(AggregatedListStoragePoolTypesRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetStoragePoolTypeRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListStoragePoolTypesRequest $request, array $optionalArgs = []) + */ +final class StoragePoolTypesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.StoragePoolTypes'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/StoragePoolTypesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/StoragePoolTypesClient/get.php + * + * @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()} . + * + * @example samples/V1/StoragePoolTypesClient/list.php + * + * @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..42c9b35b383f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/StoragePoolsClient.php @@ -0,0 +1,519 @@ + aggregatedListAsync(AggregatedListStoragePoolsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteStoragePoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetStoragePoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicyStoragePoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertStoragePoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListStoragePoolsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDisksAsync(ListDisksStoragePoolsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicyStoragePoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsStoragePoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateStoragePoolRequest $request, array $optionalArgs = []) + */ +final class StoragePoolsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.StoragePools'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/delete.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/get.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/insert.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/list.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/list_disks.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/StoragePoolsClient/test_iam_permissions.php + * + * @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: pool_provisioned_capacity_gb, pool_provisioned_iops and pool_provisioned_throughput. + * + * The async variant is {@see StoragePoolsClient::updateAsync()} . + * + * @example samples/V1/StoragePoolsClient/update.php + * + * @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..f299172a5c94 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/SubnetworksClient.php @@ -0,0 +1,573 @@ + aggregatedListAsync(AggregatedListSubnetworksRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteSubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface expandIpCidrRangeAsync(ExpandIpCidrRangeSubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetSubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface getIamPolicyAsync(GetIamPolicySubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertSubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListSubnetworksRequest $request, array $optionalArgs = []) + * @method PromiseInterface listUsableAsync(ListUsableSubnetworksRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchSubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface setIamPolicyAsync(SetIamPolicySubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface setPrivateIpGoogleAccessAsync(SetPrivateIpGoogleAccessSubnetworkRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsSubnetworkRequest $request, array $optionalArgs = []) + */ +final class SubnetworksClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Subnetworks'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/delete.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/expand_ip_cidr_range.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/get.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/get_iam_policy.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/insert.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/list.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/list_usable.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/patch.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/set_iam_policy.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/set_private_ip_google_access.php + * + * @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()} . + * + * @example samples/V1/SubnetworksClient/test_iam_permissions.php + * + * @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..4b1b50b5bb66 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetGrpcProxiesClient.php @@ -0,0 +1,374 @@ + deleteAsync(DeleteTargetGrpcProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetGrpcProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetGrpcProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetGrpcProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchTargetGrpcProxyRequest $request, array $optionalArgs = []) + */ +final class TargetGrpcProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetGrpcProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetGrpcProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetGrpcProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetGrpcProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetGrpcProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetGrpcProxiesClient/patch.php + * + * @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..f79c932597eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpProxiesClient.php @@ -0,0 +1,430 @@ + aggregatedListAsync(AggregatedListTargetHttpProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetHttpProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchTargetHttpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setUrlMapAsync(SetUrlMapTargetHttpProxyRequest $request, array $optionalArgs = []) + */ +final class TargetHttpProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetHttpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/patch.php + * + * @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()} . + * + * @example samples/V1/TargetHttpProxiesClient/set_url_map.php + * + * @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..ef57911890fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetHttpsProxiesClient.php @@ -0,0 +1,543 @@ + aggregatedListAsync(AggregatedListTargetHttpsProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetHttpsProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setCertificateMapAsync(SetCertificateMapTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setQuicOverrideAsync(SetQuicOverrideTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSslCertificatesAsync(SetSslCertificatesTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSslPolicyAsync(SetSslPolicyTargetHttpsProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setUrlMapAsync(SetUrlMapTargetHttpsProxyRequest $request, array $optionalArgs = []) + */ +final class TargetHttpsProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetHttpsProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/patch.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/set_certificate_map.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/set_quic_override.php + * + * @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()} + * . + * + * @example samples/V1/TargetHttpsProxiesClient/set_ssl_certificates.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/set_ssl_policy.php + * + * @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()} . + * + * @example samples/V1/TargetHttpsProxiesClient/set_url_map.php + * + * @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..aa973eb9babf --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetInstancesClient.php @@ -0,0 +1,403 @@ + aggregatedListAsync(AggregatedListTargetInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteTargetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetInstanceRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetInstancesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSecurityPolicyAsync(SetSecurityPolicyTargetInstanceRequest $request, array $optionalArgs = []) + */ +final class TargetInstancesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetInstances'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetInstancesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/TargetInstancesClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetInstancesClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetInstancesClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetInstancesClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetInstancesClient/set_security_policy.php + * + * @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..a9aaeda81bc9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetPoolsClient.php @@ -0,0 +1,572 @@ + addHealthCheckAsync(AddHealthCheckTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface addInstanceAsync(AddInstanceTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface aggregatedListAsync(AggregatedListTargetPoolsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface getHealthAsync(GetHealthTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetPoolsRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeHealthCheckAsync(RemoveHealthCheckTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface removeInstanceAsync(RemoveInstanceTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface setBackupAsync(SetBackupTargetPoolRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSecurityPolicyAsync(SetSecurityPolicyTargetPoolRequest $request, array $optionalArgs = []) + */ +final class TargetPoolsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetPools'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/add_health_check.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/add_instance.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/get_health.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/remove_health_check.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/remove_instance.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/set_backup.php + * + * @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()} . + * + * @example samples/V1/TargetPoolsClient/set_security_policy.php + * + * @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..7d17a4f1144f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetSslProxiesClient.php @@ -0,0 +1,486 @@ + deleteAsync(DeleteTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetSslProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setBackendServiceAsync(SetBackendServiceTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setCertificateMapAsync(SetCertificateMapTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setProxyHeaderAsync(SetProxyHeaderTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSslCertificatesAsync(SetSslCertificatesTargetSslProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setSslPolicyAsync(SetSslPolicyTargetSslProxyRequest $request, array $optionalArgs = []) + */ +final class TargetSslProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetSslProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/set_backend_service.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/set_certificate_map.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/set_proxy_header.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/set_ssl_certificates.php + * + * @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()} . + * + * @example samples/V1/TargetSslProxiesClient/set_ssl_policy.php + * + * @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..ee34b1f6b3eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetTcpProxiesClient.php @@ -0,0 +1,430 @@ + aggregatedListAsync(AggregatedListTargetTcpProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetTcpProxiesRequest $request, array $optionalArgs = []) + * @method PromiseInterface setBackendServiceAsync(SetBackendServiceTargetTcpProxyRequest $request, array $optionalArgs = []) + * @method PromiseInterface setProxyHeaderAsync(SetProxyHeaderTargetTcpProxyRequest $request, array $optionalArgs = []) + */ +final class TargetTcpProxiesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetTcpProxies'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/set_backend_service.php + * + * @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()} . + * + * @example samples/V1/TargetTcpProxiesClient/set_proxy_header.php + * + * @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..cd92d34df3f3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/TargetVpnGatewaysClient.php @@ -0,0 +1,403 @@ + aggregatedListAsync(AggregatedListTargetVpnGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteTargetVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetTargetVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertTargetVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListTargetVpnGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsTargetVpnGatewayRequest $request, array $optionalArgs = []) + */ +final class TargetVpnGatewaysClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.TargetVpnGateways'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/TargetVpnGatewaysClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/TargetVpnGatewaysClient/delete.php + * + * @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()} . + * + * @example samples/V1/TargetVpnGatewaysClient/get.php + * + * @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()} . + * + * @example samples/V1/TargetVpnGatewaysClient/insert.php + * + * @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()} . + * + * @example samples/V1/TargetVpnGatewaysClient/list.php + * + * @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()} . + * + * @example samples/V1/TargetVpnGatewaysClient/set_labels.php + * + * @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..1861e1a26d34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/UrlMapsClient.php @@ -0,0 +1,487 @@ + aggregatedListAsync(AggregatedListUrlMapsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface invalidateCacheAsync(InvalidateCacheUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListUrlMapsRequest $request, array $optionalArgs = []) + * @method PromiseInterface patchAsync(PatchUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAsync(UpdateUrlMapRequest $request, array $optionalArgs = []) + * @method PromiseInterface validateAsync(ValidateUrlMapRequest $request, array $optionalArgs = []) + */ +final class UrlMapsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.UrlMaps'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/delete.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/get.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/insert.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/invalidate_cache.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/list.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/patch.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/update.php + * + * @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()} . + * + * @example samples/V1/UrlMapsClient/validate.php + * + * @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..81aa2af83fb2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/VpnGatewaysClient.php @@ -0,0 +1,461 @@ + aggregatedListAsync(AggregatedListVpnGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface getStatusAsync(GetStatusVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListVpnGatewaysRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsVpnGatewayRequest $request, array $optionalArgs = []) + * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsVpnGatewayRequest $request, array $optionalArgs = []) + */ +final class VpnGatewaysClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.VpnGateways'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/delete.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/get.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/get_status.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/insert.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/list.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/set_labels.php + * + * @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()} . + * + * @example samples/V1/VpnGatewaysClient/test_iam_permissions.php + * + * @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..977aeacb27ab --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/VpnTunnelsClient.php @@ -0,0 +1,403 @@ + aggregatedListAsync(AggregatedListVpnTunnelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAsync(DeleteVpnTunnelRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetVpnTunnelRequest $request, array $optionalArgs = []) + * @method PromiseInterface insertAsync(InsertVpnTunnelRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListVpnTunnelsRequest $request, array $optionalArgs = []) + * @method PromiseInterface setLabelsAsync(SetLabelsVpnTunnelRequest $request, array $optionalArgs = []) + */ +final class VpnTunnelsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.VpnTunnels'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/VpnTunnelsClient/aggregated_list.php + * + * @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()} . + * + * @example samples/V1/VpnTunnelsClient/delete.php + * + * @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()} . + * + * @example samples/V1/VpnTunnelsClient/get.php + * + * @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()} . + * + * @example samples/V1/VpnTunnelsClient/insert.php + * + * @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()} . + * + * @example samples/V1/VpnTunnelsClient/list.php + * + * @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()} . + * + * @example samples/V1/VpnTunnelsClient/set_labels.php + * + * @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..cfe05df28643 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ZoneOperationsClient.php @@ -0,0 +1,291 @@ + deleteAsync(DeleteZoneOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAsync(GetZoneOperationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListZoneOperationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface waitAsync(WaitZoneOperationRequest $request, array $optionalArgs = []) + */ +final class ZoneOperationsClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.ZoneOperations'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ZoneOperationsClient/delete.php + * + * @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()} . + * + * @example samples/V1/ZoneOperationsClient/get.php + * + * @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()} . + * + * @example samples/V1/ZoneOperationsClient/list.php + * + * @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()} . + * + * @example samples/V1/ZoneOperationsClient/wait.php + * + * @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..ae730b7f05a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Client/ZonesClient.php @@ -0,0 +1,235 @@ + getAsync(GetZoneRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAsync(ListZonesRequest $request, array $optionalArgs = []) + */ +final class ZonesClient +{ + use GapicClientTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.compute.v1.Zones'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private 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. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private 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 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. + * @type false|LoggerInterface $logger + * A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the + * 'GOOGLE_SDK_PHP_LOGGING' environment flag + * } + * + * @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()} . + * + * @example samples/V1/ZonesClient/get.php + * + * @param GetZoneRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Zone + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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()} . + * + * @example samples/V1/ZonesClient/list.php + * + * @param ListZonesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function 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..e611b09427fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/AddressesGapicClient.php @@ -0,0 +1,794 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..9711c5fd34c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/AutoscalersGapicClient.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 = $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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..c221ba2f1f60 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendBucketsGapicClient.php @@ -0,0 +1,1060 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..7c4c4faaa0fe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/BackendServicesGapicClient.php @@ -0,0 +1,1369 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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 a 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..32b7feb09315 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/DisksGapicClient.php @@ -0,0 +1,1626 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..8520dc0ab004 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ExternalVpnGatewaysGapicClient.php @@ -0,0 +1,649 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..8920f7c1e433 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallPoliciesGapicClient.php @@ -0,0 +1,1382 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ]; + } + + /** + * 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..50218d0f38ad --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/FirewallsGapicClient.php @@ -0,0 +1,681 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..9acfe4b7421f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ForwardingRulesGapicClient.php @@ -0,0 +1,874 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..417c49f3473f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalAddressesGapicClient.php @@ -0,0 +1,677 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..0bc730f18b10 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalForwardingRulesGapicClient.php @@ -0,0 +1,753 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..bedb3c65705f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalNetworkEndpointGroupsGapicClient.php @@ -0,0 +1,774 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..4fd66f38d3b1 --- /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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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..01d71fd464d9 --- /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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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..5655a11eab10 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/GlobalPublicDelegatedPrefixesGapicClient.php @@ -0,0 +1,605 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..1d5c0bf35089 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/HealthChecksGapicClient.php @@ -0,0 +1,767 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..b1c68c96f6e3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ImagesGapicClient.php @@ -0,0 +1,951 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..34ac2edc71fc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagerResizeRequestsGapicClient.php @@ -0,0 +1,645 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..027e9b431c5b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupManagersGapicClient.php @@ -0,0 +1,2210 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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(); + } + + /** + * Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->resumeInstances($instanceGroupManager, $instanceGroupManagersResumeInstancesRequestResource, $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->resumeInstances($instanceGroupManager, $instanceGroupManagersResumeInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'resumeInstances'); + * while (!$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 InstanceGroupManagersResumeInstancesRequest $instanceGroupManagersResumeInstancesRequestResource 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 resumeInstances($instanceGroupManager, $instanceGroupManagersResumeInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new ResumeInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersResumeInstancesRequestResource($instanceGroupManagersResumeInstancesRequestResource); + $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('ResumeInstances', $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(); + } + + /** + * Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->startInstances($instanceGroupManager, $instanceGroupManagersStartInstancesRequestResource, $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->startInstances($instanceGroupManager, $instanceGroupManagersStartInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'startInstances'); + * while (!$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 InstanceGroupManagersStartInstancesRequest $instanceGroupManagersStartInstancesRequestResource 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 startInstances($instanceGroupManager, $instanceGroupManagersStartInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new StartInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersStartInstancesRequestResource($instanceGroupManagersStartInstancesRequestResource); + $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('StartInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->stopInstances($instanceGroupManager, $instanceGroupManagersStopInstancesRequestResource, $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->stopInstances($instanceGroupManager, $instanceGroupManagersStopInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'stopInstances'); + * while (!$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 InstanceGroupManagersStopInstancesRequest $instanceGroupManagersStopInstancesRequestResource 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 stopInstances($instanceGroupManager, $instanceGroupManagersStopInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new StopInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersStopInstancesRequestResource($instanceGroupManagersStopInstancesRequestResource); + $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('StopInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request. + * + * Sample code: + * ``` + * $instanceGroupManagersClient = new InstanceGroupManagersClient(); + * try { + * $instanceGroupManager = 'instance_group_manager'; + * $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest(); + * $project = 'project'; + * $zone = 'zone'; + * $operationResponse = $instanceGroupManagersClient->suspendInstances($instanceGroupManager, $instanceGroupManagersSuspendInstancesRequestResource, $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->suspendInstances($instanceGroupManager, $instanceGroupManagersSuspendInstancesRequestResource, $project, $zone); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $instanceGroupManagersClient->resumeOperation($operationName, 'suspendInstances'); + * while (!$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 InstanceGroupManagersSuspendInstancesRequest $instanceGroupManagersSuspendInstancesRequestResource 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 suspendInstances($instanceGroupManager, $instanceGroupManagersSuspendInstancesRequestResource, $project, $zone, array $optionalArgs = []) + { + $request = new SuspendInstancesInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setInstanceGroupManagersSuspendInstancesRequestResource($instanceGroupManagersSuspendInstancesRequestResource); + $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('SuspendInstances', $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..fdb84a47c556 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceGroupsGapicClient.php @@ -0,0 +1,987 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..8b1d4e31b062 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceSettingsServiceGapicClient.php @@ -0,0 +1,358 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..b18e78c1b382 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstanceTemplatesGapicClient.php @@ -0,0 +1,763 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..ef82b502cc1a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstancesGapicClient.php @@ -0,0 +1,3925 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can 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..5632a3246af3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InstantSnapshotsGapicClient.php @@ -0,0 +1,873 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..c68529b30293 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectAttachmentsGapicClient.php @@ -0,0 +1,799 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..36cacfdd39f7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/InterconnectsGapicClient.php @@ -0,0 +1,766 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..f3fcd6123f65 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/LicensesGapicClient.php @@ -0,0 +1,677 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..72aafeabdf56 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/MachineImagesGapicClient.php @@ -0,0 +1,683 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..67846fb7faf4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkAttachmentsGapicClient.php @@ -0,0 +1,872 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..e561d8e31863 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEdgeSecurityServicesGapicClient.php @@ -0,0 +1,639 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..558d872b633a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkEndpointGroupsGapicClient.php @@ -0,0 +1,945 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..77617f724c5a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkFirewallPoliciesGapicClient.php @@ -0,0 +1,1345 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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/NetworkProfilesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkProfilesGapicClient.php new file mode 100644 index 000000000000..47106f0e3eed --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworkProfilesGapicClient.php @@ -0,0 +1,290 @@ +get($networkProfile, $project); + * } finally { + * $networkProfilesClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Compute\V1\Client\NetworkProfilesClient}. + */ +class NetworkProfilesGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.compute.v1.NetworkProfiles'; + + /** + * 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/network_profiles_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/network_profiles_descriptor_config.php', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + 'useJwtAccessWithScope' => false, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/network_profiles_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 network profile. + * + * Sample code: + * ``` + * $networkProfilesClient = new NetworkProfilesClient(); + * try { + * $networkProfile = 'network_profile'; + * $project = 'project'; + * $response = $networkProfilesClient->get($networkProfile, $project); + * } finally { + * $networkProfilesClient->close(); + * } + * ``` + * + * @param string $networkProfile Name of the network profile 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\NetworkProfile + * + * @throws ApiException if the remote call fails + */ + public function get($networkProfile, $project, array $optionalArgs = []) + { + $request = new GetNetworkProfileRequest(); + $requestParamHeaders = []; + $request->setNetworkProfile($networkProfile); + $request->setProject($project); + $requestParamHeaders['network_profile'] = $networkProfile; + $requestParamHeaders['project'] = $project; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Get', NetworkProfile::class, $optionalArgs, $request)->wait(); + } + + /** + * Retrieves a list of network profiles available to the specified project. + * + * Sample code: + * ``` + * $networkProfilesClient = new NetworkProfilesClient(); + * try { + * $project = 'project'; + * $response = $networkProfilesClient->list($project); + * } finally { + * $networkProfilesClient->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\NetworkProfilesListResponse + * + * @throws ApiException if the remote call fails + */ + public function list($project, array $optionalArgs = []) + { + $request = new ListNetworkProfilesRequest(); + $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('List', NetworkProfilesListResponse::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..684705b45bae --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NetworksGapicClient.php @@ -0,0 +1,1064 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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 routingConfig can be modified. + * + * 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..a63c008b5e3d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeGroupsGapicClient.php @@ -0,0 +1,1388 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..33a98e6bd8c3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/NodeTemplatesGapicClient.php @@ -0,0 +1,792 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..b5be51f77ed1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/PacketMirroringsGapicClient.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 = $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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..90a4b9f9b7cd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ProjectsGapicClient.php @@ -0,0 +1,1231 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..f31783ead765 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicAdvertisedPrefixesGapicClient.php @@ -0,0 +1,751 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..3d70941b0358 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/PublicDelegatedPrefixesGapicClient.php @@ -0,0 +1,866 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..6390c6f05262 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionAutoscalersGapicClient.php @@ -0,0 +1,711 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..604fb6f2b82d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionBackendServicesGapicClient.php @@ -0,0 +1,1091 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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 a 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..40119604fec3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionCommitmentsGapicClient.php @@ -0,0 +1,646 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..87e320ac09ef --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionDisksGapicClient.php @@ -0,0 +1,1522 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..1fea753e5bd9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthCheckServicesGapicClient.php @@ -0,0 +1,627 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..95e61f5c09dd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionHealthChecksGapicClient.php @@ -0,0 +1,707 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..70813084afe7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupManagersGapicClient.php @@ -0,0 +1,2112 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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(); + } + + /** + * Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. 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'; + * $regionInstanceGroupManagersResumeInstancesRequestResource = new RegionInstanceGroupManagersResumeInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->resumeInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersResumeInstancesRequestResource); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if 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->resumeInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersResumeInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'resumeInstances'); + * while (!$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 RegionInstanceGroupManagersResumeInstancesRequest $regionInstanceGroupManagersResumeInstancesRequestResource 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 resumeInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersResumeInstancesRequestResource, array $optionalArgs = []) + { + $request = new ResumeInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersResumeInstancesRequestResource($regionInstanceGroupManagersResumeInstancesRequestResource); + $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('ResumeInstances', $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(); + } + + /** + * Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. 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'; + * $regionInstanceGroupManagersStartInstancesRequestResource = new RegionInstanceGroupManagersStartInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->startInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStartInstancesRequestResource); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if 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->startInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStartInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'startInstances'); + * while (!$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 RegionInstanceGroupManagersStartInstancesRequest $regionInstanceGroupManagersStartInstancesRequestResource 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 startInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStartInstancesRequestResource, array $optionalArgs = []) + { + $request = new StartInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersStartInstancesRequestResource($regionInstanceGroupManagersStartInstancesRequestResource); + $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('StartInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 stopped. Stopped instances can be started using the startInstances method. 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'; + * $regionInstanceGroupManagersStopInstancesRequestResource = new RegionInstanceGroupManagersStopInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->stopInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStopInstancesRequestResource); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if 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->stopInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStopInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'stopInstances'); + * while (!$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 RegionInstanceGroupManagersStopInstancesRequest $regionInstanceGroupManagersStopInstancesRequestResource 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 stopInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStopInstancesRequestResource, array $optionalArgs = []) + { + $request = new StopInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersStopInstancesRequestResource($regionInstanceGroupManagersStopInstancesRequestResource); + $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('StopInstances', $optionalArgs, $request, $this->getOperationsClient(), null, Operation::class)->wait(); + } + + /** + * Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. 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 suspended. Suspended instances can be resumed using the resumeInstances method. 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'; + * $regionInstanceGroupManagersSuspendInstancesRequestResource = new RegionInstanceGroupManagersSuspendInstancesRequest(); + * $operationResponse = $regionInstanceGroupManagersClient->suspendInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSuspendInstancesRequestResource); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // if 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->suspendInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSuspendInstancesRequestResource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionInstanceGroupManagersClient->resumeOperation($operationName, 'suspendInstances'); + * while (!$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 RegionInstanceGroupManagersSuspendInstancesRequest $regionInstanceGroupManagersSuspendInstancesRequestResource 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 suspendInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSuspendInstancesRequestResource, array $optionalArgs = []) + { + $request = new SuspendInstancesRegionInstanceGroupManagerRequest(); + $requestParamHeaders = []; + $request->setInstanceGroupManager($instanceGroupManager); + $request->setProject($project); + $request->setRegion($region); + $request->setRegionInstanceGroupManagersSuspendInstancesRequestResource($regionInstanceGroupManagersSuspendInstancesRequestResource); + $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('SuspendInstances', $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..5491d2a0b82c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceGroupsGapicClient.php @@ -0,0 +1,550 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..f8cf7b9e087e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstanceTemplatesGapicClient.php @@ -0,0 +1,547 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..19fc06e796aa --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstancesGapicClient.php @@ -0,0 +1,332 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..516c991e25a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionInstantSnapshotsGapicClient.php @@ -0,0 +1,788 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..b4f665628173 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkEndpointGroupsGapicClient.php @@ -0,0 +1,804 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..5a6b547c6aa7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNetworkFirewallPoliciesGapicClient.php @@ -0,0 +1,1459 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..e26066c6fee7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionNotificationEndpointsGapicClient.php @@ -0,0 +1,547 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..3c2acf2789a6 --- /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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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..487adb5b8f5e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSecurityPoliciesGapicClient.php @@ -0,0 +1,1025 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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(); + } + + /** + * Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. + * + * Sample code: + * ``` + * $regionSecurityPoliciesClient = new RegionSecurityPoliciesClient(); + * try { + * $project = 'project'; + * $region = 'region'; + * $regionSetLabelsRequestResource = new RegionSetLabelsRequest(); + * $resource = 'resource'; + * $operationResponse = $regionSecurityPoliciesClient->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 = $regionSecurityPoliciesClient->setLabels($project, $region, $regionSetLabelsRequestResource, $resource); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $regionSecurityPoliciesClient->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 { + * $regionSecurityPoliciesClient->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 SetLabelsRegionSecurityPolicyRequest(); + $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/RegionSslCertificatesGapicClient.php b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslCertificatesGapicClient.php new file mode 100644 index 000000000000..617af4564292 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslCertificatesGapicClient.php @@ -0,0 +1,547 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..4d359d4dc233 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionSslPoliciesGapicClient.php @@ -0,0 +1,702 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..6ee6bb45e9a6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpProxiesGapicClient.php @@ -0,0 +1,628 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..89ab39897954 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetHttpsProxiesGapicClient.php @@ -0,0 +1,789 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..7025523738be --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionTargetTcpProxiesGapicClient.php @@ -0,0 +1,547 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..efd673dbbb3f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RegionUrlMapsGapicClient.php @@ -0,0 +1,760 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..ab6336bcf0a5 --- /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. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method. + * + * 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. This method fails if the quota information is unavailable for the region and if the organization policy constraint compute.requireBasicQuotaInResponse is enforced. This constraint, when enforced, disables the fail-open behaviour when quota information (the `items.quotas` field) is unavailable for the region. It is recommended to use the default setting for the constraint unless your application requires the fail-closed behaviour for this method. + * + * 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..f20ada773620 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ReservationsGapicClient.php @@ -0,0 +1,964 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..22caafdd6b04 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ResourcePoliciesGapicClient.php @@ -0,0 +1,878 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..de05a9da1293 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutersGapicClient.php @@ -0,0 +1,1048 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..a96808fb4729 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/RoutesGapicClient.php @@ -0,0 +1,529 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..08ff5c1616bb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SecurityPoliciesGapicClient.php @@ -0,0 +1,1146 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..b5397e343a02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/ServiceAttachmentsGapicClient.php @@ -0,0 +1,872 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..fcf1bf28afe6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotSettingsServiceGapicClient.php @@ -0,0 +1,348 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..f310035bc0a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SnapshotsGapicClient.php @@ -0,0 +1,748 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..32e41350c56f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SslCertificatesGapicClient.php @@ -0,0 +1,615 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..807a9966ee4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SslPoliciesGapicClient.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 = $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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..9e0b78f99023 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/StoragePoolsGapicClient.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 = $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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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: pool_provisioned_capacity_gb, pool_provisioned_iops and pool_provisioned_throughput. + * + * 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..2aa0766cee68 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/SubnetworksGapicClient.php @@ -0,0 +1,1126 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..cf164d7310ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetGrpcProxiesGapicClient.php @@ -0,0 +1,605 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..7aae8dbe42d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpProxiesGapicClient.php @@ -0,0 +1,768 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..b5578386c792 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetHttpsProxiesGapicClient.php @@ -0,0 +1,1076 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..cc6a15993ffb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetInstancesGapicClient.php @@ -0,0 +1,713 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ]; + } + + /** + * 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..d91e7171c9d4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetPoolsGapicClient.php @@ -0,0 +1,1191 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..bacbe06b979b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetSslProxiesGapicClient.php @@ -0,0 +1,914 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..c6d27aab94d6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetTcpProxiesGapicClient.php @@ -0,0 +1,769 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..7fdc1d517b7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/TargetVpnGatewaysGapicClient.php @@ -0,0 +1,713 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..a123b1bb5214 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/UrlMapsGapicClient.php @@ -0,0 +1,893 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ]; + } + + /** + * 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..86f4ef0f1697 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnGatewaysGapicClient.php @@ -0,0 +1,815 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..1ad86acf7a8b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/Gapic/VpnTunnelsGapicClient.php @@ -0,0 +1,713 @@ +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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ]; + } + + /** + * 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..1783e682254b --- /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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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, or its unique numeric identifier. + * @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..770b9fb89555 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/addresses_descriptor_config.php @@ -0,0 +1,256 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..23d5073171c9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/autoscalers_descriptor_config.php @@ -0,0 +1,244 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..59279f0d4a76 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_buckets_descriptor_config.php @@ -0,0 +1,352 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..7d65359274b6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/backend_services_descriptor_config.php @@ -0,0 +1,444 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..fc3ca3530192 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/disks_descriptor_config.php @@ -0,0 +1,644 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..a14c455bc34a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/external_vpn_gateways_descriptor_config.php @@ -0,0 +1,180 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..aaaf945f35a5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewall_policies_descriptor_config.php @@ -0,0 +1,368 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOrganizationOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOrganizationOperationRequest', + ], + '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..4af7d11e0bfe --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/firewalls_descriptor_config.php @@ -0,0 +1,196 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..4a9f264a3a97 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/forwarding_rules_descriptor_config.php @@ -0,0 +1,297 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..72a77f6a669f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_addresses_descriptor_config.php @@ -0,0 +1,196 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..724058404fe7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_forwarding_rules_descriptor_config.php @@ -0,0 +1,230 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..130d7819d751 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_network_endpoint_groups_descriptor_config.php @@ -0,0 +1,222 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..f78135a5ee81 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/global_public_delegated_prefixes_descriptor_config.php @@ -0,0 +1,162 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..a0fd850e2053 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/health_checks_descriptor_config.php @@ -0,0 +1,216 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..9708adbf2d3c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/images_descriptor_config.php @@ -0,0 +1,302 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..4e85142dbebd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_manager_resize_requests_descriptor_config.php @@ -0,0 +1,225 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..fe256efaa899 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_client_config.json @@ -0,0 +1,165 @@ +{ + "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" + }, + "ResumeInstances": { + "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" + }, + "StartInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SuspendInstances": { + "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..3b06d9a1839a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_descriptor_config.php @@ -0,0 +1,926 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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', + ], + ], + ], + ], + 'ResumeInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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', + ], + ], + ], + ], + 'StartInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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', + ], + ], + ], + ], + 'StopInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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', + ], + ], + ], + ], + 'SuspendInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..9b4d22c91e02 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_group_managers_rest_client_config.php @@ -0,0 +1,612 @@ + [ + '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', + ], + ], + 'ResumeInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resumeInstances', + 'body' => 'instance_group_managers_resume_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'StartInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/startInstances', + 'body' => 'instance_group_managers_start_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'StopInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/stopInstances', + 'body' => 'instance_group_managers_stop_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'zone' => [ + 'getters' => [ + 'getZone', + ], + ], + ], + ], + 'SuspendInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/suspendInstances', + 'body' => 'instance_group_managers_suspend_instances_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..4971e26329c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_groups_descriptor_config.php @@ -0,0 +1,329 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..3b1b2ec098d5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_settings_service_descriptor_config.php @@ -0,0 +1,81 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..d20cb8a9da62 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instance_templates_descriptor_config.php @@ -0,0 +1,202 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..de73c3da9eb1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instances_descriptor_config.php @@ -0,0 +1,1769 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..001b345b90c5 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/instant_snapshots_descriptor_config.php @@ -0,0 +1,287 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..a14d1e3b3c4e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnect_attachments_descriptor_config.php @@ -0,0 +1,256 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..f44a2fd970d2 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/interconnects_descriptor_config.php @@ -0,0 +1,232 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..a20691939db9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/licenses_descriptor_config.php @@ -0,0 +1,182 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..e19f7bc45e45 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/machine_images_descriptor_config.php @@ -0,0 +1,182 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..314008e1bd10 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_attachments_descriptor_config.php @@ -0,0 +1,287 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..8ec1dc25a869 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_edge_security_services_descriptor_config.php @@ -0,0 +1,189 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..35c568f36371 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_endpoint_groups_descriptor_config.php @@ -0,0 +1,312 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..9e42e56c0426 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_firewall_policies_descriptor_config.php @@ -0,0 +1,456 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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/network_profiles_client_config.json b/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_client_config.json new file mode 100644 index 000000000000..ac1afb604ff0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_client_config.json @@ -0,0 +1,45 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NetworkProfiles": { + "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/network_profiles_descriptor_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_descriptor_config.php new file mode 100644 index 000000000000..cb50d78b9424 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_descriptor_config.php @@ -0,0 +1,58 @@ + [ + 'google.cloud.compute.v1.NetworkProfiles' => [ + 'Get' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkProfile', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + [ + 'keyName' => 'network_profile', + 'fieldAccessors' => [ + 'getNetworkProfile', + ], + ], + ], + ], + 'List' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Compute\V1\NetworkProfilesListResponse', + 'headerParams' => [ + [ + 'keyName' => 'project', + 'fieldAccessors' => [ + 'getProject', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_rest_client_config.php b/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_rest_client_config.php new file mode 100644 index 000000000000..0b94d2a1d29c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/network_profiles_rest_client_config.php @@ -0,0 +1,55 @@ + [ + 'google.cloud.compute.v1.NetworkProfiles' => [ + 'Get' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkProfiles/{network_profile}', + 'placeholders' => [ + 'network_profile' => [ + 'getters' => [ + 'getNetworkProfile', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + ], + ], + 'List' => [ + 'method' => 'get', + 'uriTemplate' => '/compute/v1/projects/{project}/global/networkProfiles', + 'placeholders' => [ + '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..ed750c089341 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/networks_descriptor_config.php @@ -0,0 +1,342 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..31aa831596c4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_groups_descriptor_config.php @@ -0,0 +1,524 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..7b35cdfe1204 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/node_templates_descriptor_config.php @@ -0,0 +1,246 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..119da9930576 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/packet_mirrorings_descriptor_config.php @@ -0,0 +1,239 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..b2c2dd588fc4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/projects_descriptor_config.php @@ -0,0 +1,372 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..3a29eaa67167 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_advertised_prefixes_descriptor_config.php @@ -0,0 +1,230 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..6c885df5ceff --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/public_delegated_prefixes_descriptor_config.php @@ -0,0 +1,297 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..8bcae074d7eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_autoscalers_descriptor_config.php @@ -0,0 +1,224 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..73f393fbaf28 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_backend_services_descriptor_config.php @@ -0,0 +1,399 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..c29f72994964 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_commitments_descriptor_config.php @@ -0,0 +1,174 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..876f682e86d7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_disks_descriptor_config.php @@ -0,0 +1,624 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..3462ddb4e619 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_check_services_descriptor_config.php @@ -0,0 +1,195 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..889a9bc7f3e1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_health_checks_descriptor_config.php @@ -0,0 +1,236 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..2bf7daa69f09 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_client_config.json @@ -0,0 +1,160 @@ +{ + "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" + }, + "ResumeInstances": { + "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" + }, + "StartInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "StopInstances": { + "timeout_millis": 600000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "SuspendInstances": { + "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..cd9e52e29bf6 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_descriptor_config.php @@ -0,0 +1,906 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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', + ], + ], + ], + ], + 'ResumeInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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', + ], + ], + ], + ], + 'StartInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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', + ], + ], + ], + ], + 'StopInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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', + ], + ], + ], + ], + 'SuspendInstances' => [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..2d59f243b43c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_group_managers_rest_client_config.php @@ -0,0 +1,601 @@ + [ + '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', + ], + ], + 'ResumeInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/resumeInstances', + 'body' => 'region_instance_group_managers_resume_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + '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', + ], + ], + ], + ], + 'StartInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/startInstances', + 'body' => 'region_instance_group_managers_start_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'StopInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/stopInstances', + 'body' => 'region_instance_group_managers_stop_instances_request_resource', + 'placeholders' => [ + 'instance_group_manager' => [ + 'getters' => [ + 'getInstanceGroupManager', + ], + ], + 'project' => [ + 'getters' => [ + 'getProject', + ], + ], + 'region' => [ + 'getters' => [ + 'getRegion', + ], + ], + ], + ], + 'SuspendInstances' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/suspendInstances', + 'body' => 'region_instance_group_managers_suspend_instances_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..54377f6ec294 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_groups_descriptor_config.php @@ -0,0 +1,151 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..28b4c2fe5034 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instance_templates_descriptor_config.php @@ -0,0 +1,154 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..14cb3a0cca34 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instances_descriptor_config.php @@ -0,0 +1,63 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..99cd88b469a9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_instant_snapshots_descriptor_config.php @@ -0,0 +1,267 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..0b3fe884695a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_endpoint_groups_descriptor_config.php @@ -0,0 +1,268 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..4ba5f1a4f437 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_network_firewall_policies_descriptor_config.php @@ -0,0 +1,579 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..561ebd7d00b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_notification_endpoints_descriptor_config.php @@ -0,0 +1,154 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..a1d40ba7b99c --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_client_config.json @@ -0,0 +1,95 @@ +{ + "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" + }, + "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/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..99fdd4a6c2fa --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_descriptor_config.php @@ -0,0 +1,383 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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', + ], + ], + ], + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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\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..dcd2c647fe1b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_security_policies_rest_client_config.php @@ -0,0 +1,314 @@ + [ + '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', + ], + ], + ], + ], + 'SetLabels' => [ + 'method' => 'post', + 'uriTemplate' => '/compute/v1/projects/{project}/regions/{region}/securityPolicies/{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/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..27ff6d120dcd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_certificates_descriptor_config.php @@ -0,0 +1,154 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..eed895c8ca94 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_ssl_policies_descriptor_config.php @@ -0,0 +1,213 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..1386c983a7b8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_http_proxies_descriptor_config.php @@ -0,0 +1,195 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..a06fb9935fbd --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_https_proxies_descriptor_config.php @@ -0,0 +1,277 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..c2711f770616 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_target_tcp_proxies_descriptor_config.php @@ -0,0 +1,154 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..c458fcc1915b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/region_url_maps_descriptor_config.php @@ -0,0 +1,260 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..85d670ccae7d --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/reservations_descriptor_config.php @@ -0,0 +1,328 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..2abd5f7285cc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/resource_policies_descriptor_config.php @@ -0,0 +1,287 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..4ec0c414cfab --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routers_descriptor_config.php @@ -0,0 +1,360 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..c097a74408e9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/routes_descriptor_config.php @@ -0,0 +1,128 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..d105487f6450 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/security_policies_descriptor_config.php @@ -0,0 +1,348 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..b48c6847b5c7 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/service_attachments_descriptor_config.php @@ -0,0 +1,287 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..7e19b14c49cb --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshot_settings_service_descriptor_config.php @@ -0,0 +1,68 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..26efa8ddb4a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/snapshots_descriptor_config.php @@ -0,0 +1,216 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..f242d93b154a --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_certificates_descriptor_config.php @@ -0,0 +1,148 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..4bc452fdb8bc --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/ssl_policies_descriptor_config.php @@ -0,0 +1,194 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..db8772bff3b1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/storage_pools_descriptor_config.php @@ -0,0 +1,303 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..4779c99369ac --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/subnetworks_descriptor_config.php @@ -0,0 +1,389 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..572c7b9826c1 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_grpc_proxies_descriptor_config.php @@ -0,0 +1,162 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..f262f3a1ad71 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_http_proxies_descriptor_config.php @@ -0,0 +1,216 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..c41c2bff80e8 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_https_proxies_descriptor_config.php @@ -0,0 +1,352 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..e660a2d8fff9 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_instances_descriptor_config.php @@ -0,0 +1,215 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetZoneOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteZoneOperationRequest', + ], + '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..0d2f84c88b9f --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_pools_descriptor_config.php @@ -0,0 +1,444 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..8675cbb00e7b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_ssl_proxies_descriptor_config.php @@ -0,0 +1,298 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..16a5ca2e702e --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_tcp_proxies_descriptor_config.php @@ -0,0 +1,216 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..e144f721f311 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/target_vpn_gateways_descriptor_config.php @@ -0,0 +1,215 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..979eaf979d89 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/url_maps_descriptor_config.php @@ -0,0 +1,268 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetGlobalOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteGlobalOperationRequest', + ], + '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..a6db1e9d8370 --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_gateways_descriptor_config.php @@ -0,0 +1,263 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..a9b34aff641b --- /dev/null +++ b/owl-bot-staging/Compute/V1/src/V1/resources/vpn_tunnels_descriptor_config.php @@ -0,0 +1,215 @@ + [ + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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, + 'getOperationRequest' => '\Google\Cloud\Compute\V1\GetRegionOperationRequest', + 'cancelOperationRequest' => null, + 'deleteOperationRequest' => '\Google\Cloud\Compute\V1\DeleteRegionOperationRequest', + ], + '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..c64f7c77630c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/BackendServicesClientTest.php @@ -0,0 +1,1618 @@ +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; + $ipAddressSelectionPolicy = 'ipAddressSelectionPolicy614471752'; + $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->setIpAddressSelectionPolicy($ipAddressSelectionPolicy); + $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..116de0740e0d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/BackendServicesClientTest.php @@ -0,0 +1,1809 @@ +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; + $ipAddressSelectionPolicy = 'ipAddressSelectionPolicy614471752'; + $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->setIpAddressSelectionPolicy($ipAddressSelectionPolicy); + $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..bd5b8b6bbc20 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/DisksClientTest.php @@ -0,0 +1,2291 @@ +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 + $accessMode = 'accessMode-1032586338'; + $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->setAccessMode($accessMode); + $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..b73b222a2057 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/InstanceGroupManagersClientTest.php @@ -0,0 +1,3091 @@ +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'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $targetStoppedSize = 1613032225; + $targetSuspendedSize = 765655981; + $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->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setTargetStoppedSize($targetStoppedSize); + $expectedResponse->setTargetSuspendedSize($targetSuspendedSize); + $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 resumeInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resumeInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResumeInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersResumeInstancesRequestResource($instanceGroupManagersResumeInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->resumeInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/ResumeInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersResumeInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersResumeInstancesRequestResource, $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 resumeInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new ResumeInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersResumeInstancesRequestResource($instanceGroupManagersResumeInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->resumeInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->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 startInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStartInstancesRequestResource($instanceGroupManagersStartInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->startInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/StartInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersStartInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersStartInstancesRequestResource, $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 startInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StartInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStartInstancesRequestResource($instanceGroupManagersStartInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->startInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStopInstancesRequestResource($instanceGroupManagersStopInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stopInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/StopInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersStopInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersStopInstancesRequestResource, $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 stopInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new StopInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersStopInstancesRequestResource($instanceGroupManagersStopInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->stopInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function suspendInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/suspendInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SuspendInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSuspendInstancesRequestResource($instanceGroupManagersSuspendInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->suspendInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/SuspendInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersSuspendInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersSuspendInstancesRequestResource, $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 suspendInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $request = (new SuspendInstancesInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setInstanceGroupManagersSuspendInstancesRequestResource($instanceGroupManagersSuspendInstancesRequestResource) + ->setProject($project) + ->setZone($zone); + $response = $gapicClient->suspendInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->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..4a7fae176082 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/MachineTypesClientTest.php @@ -0,0 +1,376 @@ +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 + $architecture = 'architecture839674195'; + $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->setArchitecture($architecture); + $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/NetworkProfilesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkProfilesClientTest.php new file mode 100644 index 000000000000..84d6e24edcc3 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworkProfilesClientTest.php @@ -0,0 +1,267 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkProfilesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkProfilesClient($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'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkProfile(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkProfile = 'networkProfile709983384'; + $project = 'project-309310695'; + $request = (new GetNetworkProfileRequest()) + ->setNetworkProfile($networkProfile) + ->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.NetworkProfiles/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkProfile(); + $this->assertProtobufEquals($networkProfile, $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 + $networkProfile = 'networkProfile709983384'; + $project = 'project-309310695'; + $request = (new GetNetworkProfileRequest()) + ->setNetworkProfile($networkProfile) + ->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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = 'nextPageToken-1530815211'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new NetworkProfilesListResponse(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $request = (new ListNetworkProfilesRequest()) + ->setProject($project); + $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.NetworkProfiles/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 ListNetworkProfilesRequest()) + ->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'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkProfile(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkProfile = 'networkProfile709983384'; + $project = 'project-309310695'; + $request = (new GetNetworkProfileRequest()) + ->setNetworkProfile($networkProfile) + ->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.NetworkProfiles/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkProfile(); + $this->assertProtobufEquals($networkProfile, $actualValue); + $actualValue = $actualRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $this->assertTrue($transport->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..05a842b04476 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/NetworksClientTest.php @@ -0,0 +1,1344 @@ +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'; + $networkProfile = 'networkProfile709983384'; + $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->setNetworkProfile($networkProfile); + $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..d339abaa8b57 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionBackendServicesClientTest.php @@ -0,0 +1,1423 @@ +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; + $ipAddressSelectionPolicy = 'ipAddressSelectionPolicy614471752'; + $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->setIpAddressSelectionPolicy($ipAddressSelectionPolicy); + $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..33b365edd680 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionCommitmentsClientTest.php @@ -0,0 +1,648 @@ +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'; + $customEndTimestamp = 'customEndTimestamp-1965712796'; + $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->setCustomEndTimestamp($customEndTimestamp); + $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..5919ac4131a4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionDisksClientTest.php @@ -0,0 +1,2209 @@ +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 + $accessMode = 'accessMode-1032586338'; + $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->setAccessMode($accessMode); + $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..c2d452369473 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionInstanceGroupManagersClientTest.php @@ -0,0 +1,3009 @@ +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'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $targetStoppedSize = 1613032225; + $targetSuspendedSize = 765655981; + $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->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setTargetStoppedSize($targetStoppedSize); + $expectedResponse->setTargetSuspendedSize($targetSuspendedSize); + $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 resumeInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resumeInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersResumeInstancesRequestResource = new RegionInstanceGroupManagersResumeInstancesRequest(); + $request = (new ResumeInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersResumeInstancesRequestResource($regionInstanceGroupManagersResumeInstancesRequestResource); + $response = $gapicClient->resumeInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/ResumeInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersResumeInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersResumeInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function resumeInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersResumeInstancesRequestResource = new RegionInstanceGroupManagersResumeInstancesRequest(); + $request = (new ResumeInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersResumeInstancesRequestResource($regionInstanceGroupManagersResumeInstancesRequestResource); + $response = $gapicClient->resumeInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->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 startInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersStartInstancesRequestResource = new RegionInstanceGroupManagersStartInstancesRequest(); + $request = (new StartInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStartInstancesRequestResource($regionInstanceGroupManagersStartInstancesRequestResource); + $response = $gapicClient->startInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/StartInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersStartInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersStartInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function startInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersStartInstancesRequestResource = new RegionInstanceGroupManagersStartInstancesRequest(); + $request = (new StartInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStartInstancesRequestResource($regionInstanceGroupManagersStartInstancesRequestResource); + $response = $gapicClient->startInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersStopInstancesRequestResource = new RegionInstanceGroupManagersStopInstancesRequest(); + $request = (new StopInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStopInstancesRequestResource($regionInstanceGroupManagersStopInstancesRequestResource); + $response = $gapicClient->stopInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/StopInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersStopInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersStopInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersStopInstancesRequestResource = new RegionInstanceGroupManagersStopInstancesRequest(); + $request = (new StopInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersStopInstancesRequestResource($regionInstanceGroupManagersStopInstancesRequestResource); + $response = $gapicClient->stopInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function suspendInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/suspendInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSuspendInstancesRequestResource = new RegionInstanceGroupManagersSuspendInstancesRequest(); + $request = (new SuspendInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSuspendInstancesRequestResource($regionInstanceGroupManagersSuspendInstancesRequestResource); + $response = $gapicClient->suspendInstances($request); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/SuspendInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersSuspendInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersSuspendInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function suspendInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersSuspendInstancesRequestResource = new RegionInstanceGroupManagersSuspendInstancesRequest(); + $request = (new SuspendInstancesRegionInstanceGroupManagerRequest()) + ->setInstanceGroupManager($instanceGroupManager) + ->setProject($project) + ->setRegion($region) + ->setRegionInstanceGroupManagersSuspendInstancesRequestResource($regionInstanceGroupManagersSuspendInstancesRequestResource); + $response = $gapicClient->suspendInstances($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->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..3b930291adbe --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionSecurityPoliciesClientTest.php @@ -0,0 +1,1323 @@ +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 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 SetLabelsRegionSecurityPolicyRequest()) + ->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.RegionSecurityPolicies/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 SetLabelsRegionSecurityPolicyRequest()) + ->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 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..ac94e2c22f46 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RegionTargetHttpsProxiesClientTest.php @@ -0,0 +1,988 @@ +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'; + $tlsEarlyData = 'tlsEarlyData-1549504310'; + $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->setTlsEarlyData($tlsEarlyData); + $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..75c00b3f2924 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/RoutesClientTest.php @@ -0,0 +1,563 @@ +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'; + $nextHopInterRegionCost = 1586170733; + $nextHopIp = 'nextHopIp1184061353'; + $nextHopMed = 1948800118; + $nextHopNetwork = 'nextHopNetwork1872908524'; + $nextHopOrigin = 'nextHopOrigin-1561859928'; + $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->setNextHopInterRegionCost($nextHopInterRegionCost); + $expectedResponse->setNextHopIp($nextHopIp); + $expectedResponse->setNextHopMed($nextHopMed); + $expectedResponse->setNextHopNetwork($nextHopNetwork); + $expectedResponse->setNextHopOrigin($nextHopOrigin); + $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..159d4346873d --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/ServiceAttachmentsClientTest.php @@ -0,0 +1,1023 @@ +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'; + $propagatedConnectionLimit = 1814764418; + $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->setPropagatedConnectionLimit($propagatedConnectionLimit); + $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..a8821b0784fa --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/Client/TargetHttpsProxiesClientTest.php @@ -0,0 +1,1383 @@ +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'; + $tlsEarlyData = 'tlsEarlyData-1549504310'; + $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->setTlsEarlyData($tlsEarlyData); + $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..d5f32b745fee --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/DisksClientTest.php @@ -0,0 +1,2045 @@ +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 + $accessMode = 'accessMode-1032586338'; + $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->setAccessMode($accessMode); + $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..1098a5684481 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/InstanceGroupManagersClientTest.php @@ -0,0 +1,2777 @@ +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'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $targetStoppedSize = 1613032225; + $targetSuspendedSize = 765655981; + $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->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setTargetStoppedSize($targetStoppedSize); + $expectedResponse->setTargetSuspendedSize($targetSuspendedSize); + $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 resumeInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resumeInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->resumeInstances($instanceGroupManager, $instanceGroupManagersResumeInstancesRequestResource, $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/ResumeInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersResumeInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersResumeInstancesRequestResource, $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 resumeInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersResumeInstancesRequestResource = new InstanceGroupManagersResumeInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->resumeInstances($instanceGroupManager, $instanceGroupManagersResumeInstancesRequestResource, $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 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 startInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->startInstances($instanceGroupManager, $instanceGroupManagersStartInstancesRequestResource, $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/StartInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersStartInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersStartInstancesRequestResource, $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 startInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersStartInstancesRequestResource = new InstanceGroupManagersStartInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->startInstances($instanceGroupManager, $instanceGroupManagersStartInstancesRequestResource, $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 stopInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stopInstances($instanceGroupManager, $instanceGroupManagersStopInstancesRequestResource, $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/StopInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersStopInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersStopInstancesRequestResource, $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 stopInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersStopInstancesRequestResource = new InstanceGroupManagersStopInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->stopInstances($instanceGroupManager, $instanceGroupManagersStopInstancesRequestResource, $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 suspendInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/suspendInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->suspendInstances($instanceGroupManager, $instanceGroupManagersSuspendInstancesRequestResource, $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/SuspendInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getInstanceGroupManagersSuspendInstancesRequestResource(); + $this->assertProtobufEquals($instanceGroupManagersSuspendInstancesRequestResource, $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 suspendInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new ZoneOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $instanceGroupManagersSuspendInstancesRequestResource = new InstanceGroupManagersSuspendInstancesRequest(); + $project = 'project-309310695'; + $zone = 'zone3744684'; + $response = $gapicClient->suspendInstances($instanceGroupManager, $instanceGroupManagersSuspendInstancesRequestResource, $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..053554d78909 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/MachineTypesClientTest.php @@ -0,0 +1,311 @@ +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 + $architecture = 'architecture839674195'; + $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->setArchitecture($architecture); + $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/NetworkProfilesClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkProfilesClientTest.php new file mode 100644 index 000000000000..88ee02cd42b4 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworkProfilesClientTest.php @@ -0,0 +1,208 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return NetworkProfilesClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new NetworkProfilesClient($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'; + $selfLinkWithId = 'selfLinkWithId-1029220862'; + $zone = 'zone3744684'; + $expectedResponse = new NetworkProfile(); + $expectedResponse->setCreationTimestamp($creationTimestamp); + $expectedResponse->setDescription($description); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setName($name); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setSelfLinkWithId($selfLinkWithId); + $expectedResponse->setZone($zone); + $transport->addResponse($expectedResponse); + // Mock request + $networkProfile = 'networkProfile709983384'; + $project = 'project-309310695'; + $response = $gapicClient->get($networkProfile, $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.NetworkProfiles/Get', $actualFuncCall); + $actualValue = $actualRequestObject->getNetworkProfile(); + $this->assertProtobufEquals($networkProfile, $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 + $networkProfile = 'networkProfile709983384'; + $project = 'project-309310695'; + try { + $gapicClient->get($networkProfile, $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 + $etag = 'etag3123477'; + $id = 'id3355'; + $kind = 'kind3292052'; + $nextPageToken = 'nextPageToken-1530815211'; + $selfLink = 'selfLink-1691268851'; + $expectedResponse = new NetworkProfilesListResponse(); + $expectedResponse->setEtag($etag); + $expectedResponse->setId($id); + $expectedResponse->setKind($kind); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setSelfLink($selfLink); + $transport->addResponse($expectedResponse); + // Mock request + $project = 'project-309310695'; + $response = $gapicClient->list($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.NetworkProfiles/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/NetworksClientTest.php b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworksClientTest.php new file mode 100644 index 000000000000..75cff1ec2076 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/NetworksClientTest.php @@ -0,0 +1,1194 @@ +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'; + $networkProfile = 'networkProfile709983384'; + $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->setNetworkProfile($networkProfile); + $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..8596af1813a0 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionBackendServicesClientTest.php @@ -0,0 +1,1239 @@ +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; + $ipAddressSelectionPolicy = 'ipAddressSelectionPolicy614471752'; + $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->setIpAddressSelectionPolicy($ipAddressSelectionPolicy); + $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..ea90b048acbd --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionCommitmentsClientTest.php @@ -0,0 +1,563 @@ +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'; + $customEndTimestamp = 'customEndTimestamp-1965712796'; + $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->setCustomEndTimestamp($customEndTimestamp); + $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..db61032f198c --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionDisksClientTest.php @@ -0,0 +1,1968 @@ +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 + $accessMode = 'accessMode-1032586338'; + $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->setAccessMode($accessMode); + $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..6c400d176c80 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionInstanceGroupManagersClientTest.php @@ -0,0 +1,2700 @@ +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'; + $satisfiesPzi = false; + $satisfiesPzs = false; + $selfLink = 'selfLink-1691268851'; + $targetSize = 2084603409; + $targetStoppedSize = 1613032225; + $targetSuspendedSize = 765655981; + $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->setSatisfiesPzi($satisfiesPzi); + $expectedResponse->setSatisfiesPzs($satisfiesPzs); + $expectedResponse->setSelfLink($selfLink); + $expectedResponse->setTargetSize($targetSize); + $expectedResponse->setTargetStoppedSize($targetStoppedSize); + $expectedResponse->setTargetSuspendedSize($targetSuspendedSize); + $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 resumeInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/resumeInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersResumeInstancesRequestResource = new RegionInstanceGroupManagersResumeInstancesRequest(); + $response = $gapicClient->resumeInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersResumeInstancesRequestResource); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/ResumeInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersResumeInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersResumeInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function resumeInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/resumeInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersResumeInstancesRequestResource = new RegionInstanceGroupManagersResumeInstancesRequest(); + $response = $gapicClient->resumeInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersResumeInstancesRequestResource); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->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 startInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/startInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersStartInstancesRequestResource = new RegionInstanceGroupManagersStartInstancesRequest(); + $response = $gapicClient->startInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStartInstancesRequestResource); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/StartInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersStartInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersStartInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function startInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/startInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersStartInstancesRequestResource = new RegionInstanceGroupManagersStartInstancesRequest(); + $response = $gapicClient->startInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStartInstancesRequestResource); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/stopInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersStopInstancesRequestResource = new RegionInstanceGroupManagersStopInstancesRequest(); + $response = $gapicClient->stopInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStopInstancesRequestResource); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/StopInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersStopInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersStopInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function stopInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/stopInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersStopInstancesRequestResource = new RegionInstanceGroupManagersStopInstancesRequest(); + $response = $gapicClient->stopInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersStopInstancesRequestResource); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function suspendInstancesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $completeOperation = new Operation(); + $completeOperation->setName('customOperations/suspendInstancesTest'); + $completeOperation->setStatus(Status::DONE); + $operationsTransport->addResponse($completeOperation); + // Mock request + $instanceGroupManager = 'instanceGroupManager-1361249341'; + $project = 'project-309310695'; + $region = 'region-934795532'; + $regionInstanceGroupManagersSuspendInstancesRequestResource = new RegionInstanceGroupManagersSuspendInstancesRequest(); + $response = $gapicClient->suspendInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSuspendInstancesRequestResource); + $this->assertFalse($response->isDone()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, 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/SuspendInstances', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getInstanceGroupManager(); + $this->assertProtobufEquals($instanceGroupManager, $actualValue); + $actualValue = $actualApiRequestObject->getProject(); + $this->assertProtobufEquals($project, $actualValue); + $actualValue = $actualApiRequestObject->getRegion(); + $this->assertProtobufEquals($region, $actualValue); + $actualValue = $actualApiRequestObject->getRegionInstanceGroupManagersSuspendInstancesRequestResource(); + $this->assertProtobufEquals($regionInstanceGroupManagersSuspendInstancesRequestResource, $actualValue); + $expectedOperationsRequestObject = new GetRegionOperationRequest(); + $expectedOperationsRequestObject->setOperation($completeOperation->getName()); + $expectedOperationsRequestObject->setProject($project); + $expectedOperationsRequestObject->setRegion($region); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.compute.v1.RegionOperations/Get', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function suspendInstancesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new RegionOperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('customOperations/suspendInstancesExceptionTest'); + $incompleteOperation->setStatus(Status::RUNNING); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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'; + $regionInstanceGroupManagersSuspendInstancesRequestResource = new RegionInstanceGroupManagersSuspendInstancesRequest(); + $response = $gapicClient->suspendInstances($instanceGroupManager, $project, $region, $regionInstanceGroupManagersSuspendInstancesRequestResource); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->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..1564d3fd61eb --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionSecurityPoliciesClientTest.php @@ -0,0 +1,1155 @@ +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()); + } + + /** @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.RegionSecurityPolicies/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/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..55fce50a607a --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RegionTargetHttpsProxiesClientTest.php @@ -0,0 +1,853 @@ +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'; + $tlsEarlyData = 'tlsEarlyData-1549504310'; + $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->setTlsEarlyData($tlsEarlyData); + $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..f8871703128a --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/RoutesClientTest.php @@ -0,0 +1,474 @@ +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'; + $nextHopInterRegionCost = 1586170733; + $nextHopIp = 'nextHopIp1184061353'; + $nextHopMed = 1948800118; + $nextHopNetwork = 'nextHopNetwork1872908524'; + $nextHopOrigin = 'nextHopOrigin-1561859928'; + $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->setNextHopInterRegionCost($nextHopInterRegionCost); + $expectedResponse->setNextHopIp($nextHopIp); + $expectedResponse->setNextHopMed($nextHopMed); + $expectedResponse->setNextHopNetwork($nextHopNetwork); + $expectedResponse->setNextHopOrigin($nextHopOrigin); + $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..49fdaba0b789 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/ServiceAttachmentsClientTest.php @@ -0,0 +1,898 @@ +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'; + $propagatedConnectionLimit = 1814764418; + $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->setPropagatedConnectionLimit($propagatedConnectionLimit); + $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..0ff24e314955 --- /dev/null +++ b/owl-bot-staging/Compute/V1/tests/Unit/V1/TargetHttpsProxiesClientTest.php @@ -0,0 +1,1254 @@ +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'; + $tlsEarlyData = 'tlsEarlyData-1549504310'; + $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->setTlsEarlyData($tlsEarlyData); + $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()); + } +}